项目实战-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'
)
相关推荐
卷心菜不卷Iris15 分钟前
第1章大型互联网公司的基础架构——1.9 LSM Tree
数据库·lsm-tree·互联网大厂·基础架构
GISer_Qing1 小时前
ASP.NET Core 8.0学习笔记(二十七)——数据迁移:Migrations深入与其他迁移命令
数据库·c#·.netcore·entityframework
蓝桉8021 小时前
图片爬取案例
开发语言·数据库·python
Ljw...1 小时前
DeepSeek+Kimi生成高质量PPT
数据库·c++·powerpoint·ppt·deepseek
m0_748240542 小时前
数据库操作与数据管理——Rust 与 SQLite 的集成
数据库·rust·sqlite
生产队队长2 小时前
ThinkPHP:配置Redis并使用
android·数据库·redis
致奋斗的我们2 小时前
HAProxy介绍与编译安装
linux·汇编·数据库·mysql·青少年编程·haproxy·openeurler
偏右右2 小时前
UNION 联合查询
数据库·sql
Mr-Apple2 小时前
MySQL的Union和OR查询
android·数据库·mysql
YGGP3 小时前
【每日八股】Redis篇(二):数据结构
数据结构·数据库·redis