项目实战-tpshop商城项目

项目实战-tpshop商城项目

环境部署准备

软件工具准备

  • 虚拟机(本地)/云服务器(实体机)--远程服务
  • vmware虚拟机(电脑)
  • Linux
  • centos-->Linux系统的一个发行版本
  • 电脑上的系统

远程连接测试

远程连接测试-查看虚拟机IP地址

在linux虚拟机中输入ifconfig命令,查看对应的IP地址。

远程连接测试-检测本机与虚拟机是否连通

远程连接测试-通过远程工具连接linux服务器

常见问题处理

环境部署

项目技术架构介绍

部署tpshop项目-tpshop验证

数据库验证

用户信息表
  • 用户信息表: tp_users

  • 用户地址信息表: tp_user_address

熟悉商品表信息
  • 商品信息表: tp_goods
  • 商品分类信息表: tp_goods_category
  • 商品图片信息表: tp_goods_image

订单表信息
  • 订单信息表: tp_order
  • 订单商品信息表: tp_order_goods
  • 购物车表: tp_cart

数据查询演练

查询Tpshop的商品分类信息
  • 在数据库中查询出商品分类类目


  • 查询出手机数码的分类类目
sql 复制代码
-- 查询手机数码的分类类目
-- 如何找到31
select name from tp_goods_category where parent_id=31

-- 手机数码的id就是31
select id from tp_goods_category where mobile_name='手机数码'

-- 上一步的子查询(充当条件)
select name from tp_goods_category where parent_id=(
select id from tp_goods_category where mobile_name='手机数码'
)

-- 查询手机通讯的分类类目
-- 如何找到32
select name from tp_goods_category where parent_id=32

-- 手机通讯的id就是32
select id from tp_goods_category where name='手机通讯'

-- 上一步的子查询(充当条件)
select name from tp_goods_category where parent_id=(
select id from tp_goods_category where name='手机通讯'
)
查询Tpshop的订单信息
sql 复制代码
-- 查询Tpshop中当前用户的订单的信息
-- 13800138006
-- 1.找到登录用户的user_id,用手机号进行过滤
select user_id from tp_users where mobile='13800138006'
-- 2.找订单,通过user_id,进行过滤
select * from tp_order where user_id
-- 3.子查询
select * from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
-- 4.返回订单的order_id
select order_id from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
-- 5.查商品信息
select * from tp_order_goods where order_id in (
select order_id from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
)
查询Tpshop中购物车的信息
sql 复制代码
-- 查询出Tpshop当前用户的购物车的信息
select user_id from tp_users where mobile='13800138006'
select * from tp_cart where user_id=(
select user_id from tp_users where mobile='13800138006'
)
相关推荐
zjttsh39 分钟前
MySQL加减间隔时间函数DATE_ADD和DATE_SUB的详解
android·数据库·mysql
顾北1243 分钟前
SpringCloud 系列 04:Gateway 断言 / 过滤器 / 限流 一站式落地指南
java·开发语言·数据库
禹凕1 小时前
MYSQL——基础知识(NULL 值处理)
数据库·mysql
码云数智-大飞1 小时前
SQL Server 无法启动?常见原因及详细解决方法指南
数据库
8486981191 小时前
MySQL 只读库踩坑实录:为什么 INSERT/UPDATE 不报错,DELETE 却直接炸了?
数据库·mysql·hibernate
没事偷着乐琅1 小时前
二、Pandas 是啥 是数据库吗?
数据库·pandas
rfidunion2 小时前
busybox1.20.2编译过程
数据库
_codemonster2 小时前
JavaWeb开发系列(八)数据库环境配置
数据库
小刘的大模型笔记2 小时前
向量数据库实战指南:从部署到RAG落地
数据库
Hello.Reader3 小时前
从 0 到 1 理解硬盘数据恢复工具原理与工程实现
linux·运维·服务器·网络·数据库