项目实战-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'
)
相关推荐
小兜全糖(xdqt)1 天前
pyspark 从postgresql读取数据
数据库·postgresql
姓刘的哦1 天前
Qt中的QWebEngineView
数据库·c++·qt
心随_风动1 天前
Ubuntu 文件复制大师:精通cp命令完整指南
数据库·ubuntu·postgresql
不要再敲了1 天前
JDBC从入门到面试:全面掌握Java数据库连接技术
java·数据库·面试
恣艺1 天前
Redis列表(List):实现队列/栈的利器,底层原理与实战
数据库·redis·list
秋难降1 天前
零基础学习SQL(十一):SQL 索引结构|从 B+Tree 到 Hash,面试常问的 “为啥选 B+Tree” 有答案了
数据库·后端·mysql
代码的余温1 天前
Linux内核调优实战指南
linux·服务器·数据库
almighty271 天前
C# DataGridView表头自定义设置全攻略
数据库·c#·winform·datagridview·自定义表头
ljh5746491191 天前
mysql 必须在逗号分隔字符串和JSON字段之间二选一,怎么选
数据库·mysql·json
论迹1 天前
【Redis】-- 持久化
数据库·redis·缓存