当前位置:网站首页>SQL statement exercise
SQL statement exercise
2022-07-23 18:58:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Name of the experiment SQL Sentence practice Place of experiment Laboratory Building 502 Date of experiment 3.21
One 、 Purpose and requirements of the experiment 1. Deepen the understanding of the relationship between tables 2. Understand the query methods and applications of data in the database 3. Master the similarities and differences of various queries and the conversion methods between them 4. Master the implementation of various query requirements Two 、 Experimental environment Sql Sever 2008,Windows10 3、 ... and 、 Experimental content The experiment is based on SQL Server 2000 System native pubs Database, for example , Take a book publishing company as a model . First, according to the method introduced in the previous chapter pubs The database is attached to the current DBMS in , Then carry out the experiment according to the requirements . Experiment task one Check the author numbers of all authors 、 Name information 2. Check the names of all authors 、 Author number information , And display the string in front of the author number of each author “ ID number :”, Indicates that the displayed information is ID card information 3. The query in CA The author's name and city of the state 4. The date of publication is 2000.1.1-2000.12.31 Between the title and the date of publication 5. Check the books published by each publishing house 6. Check the quantity of a book sold in a store 7. Query the information of all books with sales records ( Book number 、 Title 、 Type and price ) 8. Show all book titles ( Books without sales records are also included ) 9. Query the information of sold books ( Book number 、 Title 、 Author, etc ) 10. Check all publishing businesses (business) The name of the publisher of the book Task two On the basis of task one , Practice using query statements , Include calculation Columns 、 Sum up 、 Maximum 、 minimum value 、 All kinds of choices Choose conditions 、 Character matching 、 Grouping and sorting , Experience the execution process of various queries , Lay a foundation for simple and comprehensive application . 1. Look up the title of the book T The beginning or publishing house number is 0877, And the price is greater than 16 Information about your book In ascending order of type and descending order of price ( When the type is the same ) Display the information of the book ( Title 、 author 、 Press. 、 type 、 Price ) The query sales volume is greater than 30 The title of the book and the number of sales 2. The query in 1990.1.1 To 2000.12.31 between , Total sales of each book 3. Check the city and state names of all authors , No duplicate information is required 4. Calculate how many books have been priced 5. Check the title of each book 、 The author and the total number of books it sells 6. Calculate the average price of all books 7. Check the title of the most expensive book 、 Author and price Experimental task 3 1. Refer to the primary key given in the above tables 、 Requirements for setting foreign keys , Make corresponding settings in the self created table . 2. towards authors Insert a row of author information into the table ( The specific value is self-determined ) 3. More than 100 The number of stores increased 10% A discount of 4. Delete 1994.9.14 The order of 5. Delete 1 Index established in 6. establish CA View of books written by state authors ( Include author number 、 full name 、 State of residence 、 Title 、 Price 、 Publication date ) 7. Establish payment method is cash (cash) Order view 8. establish CA View of all stores in the state Four 、 Summary of the experiment In this experiment, I learned a lot and gained a lot . Not from the beginning , Learn to operate slowly , When writing code , Always report errors , After careful examination, I still think I'm right , Finally, I found that there were always some details , I didn't notice . Through this time, I will tell myself that I must pay attention to details . |
|---|
- Check the author numbers of all authors 、 Name information
2. Check the names of all authors 、 Author number information , And display the string in front of the author number of each author “ ID number :”, Indicates that the displayed information is ID card information 3. The query in CA The author's name and city of the state 4. The date of publication is 2000.1.1-2000.12.31 Between the title and the date of publication 5. Check the books published by each publishing house 6. Check the quantity of a book sold in a store 7. Query the information of all books with sales records ( Book number 、 Title 、 Type and price )8. Show all book titles ( Books without sales records are also included ) 9. Query the information of sold books ( Book number 、 Title 、 Author, etc ) 10. Check all publishing businesses (business) The name of the publisher of the book Task two On the basis of task one , Practice using query statements , Include calculation Columns 、 Sum up 、 Maximum 、 minimum value 、 All kinds of choices Choose conditions 、 Character matching 、 Grouping and sorting , Experience the execution process of various queries , Lay a foundation for simple and comprehensive application . 1. Look up the title of the book T The beginning or publishing house number is 0877, And the price is greater than 16 Information about your book
- In ascending order of type and descending order of price ( When the type is the same ) Display the information of the book ( Title 、 author 、 Press. 、 type 、 Price )
- The query sales volume is greater than 30 The title of the book and the number of sales
2. The query in 1990.1.1 To 2000.12.31 between , Total sales of each book 3. Check the city and state names of all authors , No duplicate information is required 4. Calculate how many books have been priced 5. Check the title of each book 、 The author and the total number of books it sells 6. Calculate the average price of all books 7. Check the title of the most expensive book 、 Author and price Experimental task 3 1. Refer to the primary key given in the above tables 、 Requirements for setting foreign keys , Make corresponding settings in the self created table .2. towards authors Insert a row of author information into the table ( The specific value is self-determined ) 3. More than 100 The number of stores increased 10% A discount of 4. Delete 1994.9.14 The order of 5. Delete 1 Index established in 6. establish CA View of books written by state authors ( Include author number 、 full name 、 State of residence 、 Title 、 Price 、 Publication date )7. Establish payment method is cash (cash) Order view 8. establish CA View of all stores in the state Four 、 Summary of the experiment In this experiment, I learned a lot and gained a lot . Not from the beginning , Learn to operate slowly , When writing code , Always report errors , After careful examination, I still think I'm right , Finally, I found that there were always some details , I didn't notice . Through this time, I will tell myself that I must pay attention to details .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/126703.html Link to the original text :https://javaforall.cn
边栏推荐
- 作为3D资深建模师给刚入门学习伙伴的一些建议,用起来
- Paddlenlp之UIE分类模型【以情感倾向分析新闻分类为例】含智能标注方案)
- ?前台传参的问题待确认
- Handwriting bind, call, apply is actually very simple
- Problems and methods of creating multiple projects under one solution in VS2010
- My creation anniversary
- Multithreading and high concurrency Day11
- 自学3D建模能不能成功?自学能就业吗?
- Redis [2022 latest interview question]
- 1259. 不相交的握手 动态规划
猜你喜欢

Learn about spark project on nebulagraph

1259. 不相交的握手 動態規劃

How to understand: common code block, construction block, static block? What does it matter?

How does Apache, the world's largest open source foundation, work?

80 + guests took the stage, users from more than 10 countries attended the meeting, and 70000 + viewers watched the end of "Gwei 2022 Singapore"

ResponseBodyAdvice接口使用导致的报错及解决

有人是靠自学建模找到工作的吗?千万别让这些思维害了你

OSI模型第一层:物理层,基石般的存在!

一文了解 NebulaGraph 上的 Spark 项目
![[2020] [paper notes] Based on Rydberg atom——](/img/5c/186cae4e47a236ae4062d15f839196.png)
[2020] [paper notes] Based on Rydberg atom——
随机推荐
opencv(13):cv2.findContours、cv::findContours简要介绍及opencv各版本cv2.findContours函数说明
[sharing game modeling model making skills] how ZBrush adjusts the brush size
[whole process of game modeling model production] ZBrush weapon model production: Crossbow
Multithreading [comprehensive study of graphics and text]
What problems do you usually encounter when learning 3D modeling? It's too much
[the whole process of Game Modeling and model production] create the game soldier character with ZBrush
integer 和==比较
[2022] [paper notes] terahertz quantum well——
DevStack云计算平台快速搭建
一文了解 NebulaGraph 上的 Spark 项目
【2013】【论文笔记】太赫兹波段纳米颗粒表面增强拉曼——
How to become a modeler? Which is more popular, industrial modeling or game modeling?
LM393低功耗双电压比较器参数、引脚、应用详解
Cell array processing
【3D建模制作技巧分享】Zbrush如何将图片转浮雕模型
PCL:多直线拟合(RANSAC)
Database modeling
【2020】【论文笔记】太赫兹新型探测——太赫兹特性介绍、各种太赫兹探测器
Error "failed to fetch" XXX "temporary failure resolvingw: some index files failed to download" solution
How to realize the digital transformation of the banking industry