Alibabacloud.com offers a wide variety of articles about database normalization exercises, easily find your database normalization exercises information here online.
-12 date (including the products produced in 2017-01-12) (included in the data inserted) (5) Unified Buyer Total price of the product */--CREATE TABLE goods_list (ID INT PRIMARY KEY auto_increment, name VARCHAR, Price FLOAT (6,2 ), Pro_date date, Class VARCHAR ()) CHARACTER SET utf8;--insertion value INSERT into goods_list (name, Price, Pro_date, CLA SS) VALUES (' Apple ', 20,20170612, ' fruit '), (' Banana ', 800,20170602, ' fruit '), (' Kettle ', 120
Label:desioar Use spon data artbs create database schooldata Go use schooldata go create table Student (sno char (3) primary key, sname CH AR (8) NOT NULL, ssex char (2) is not NULL, sbirthday date, class char (5)) Go CREATE table Teacher ( Tno char (3) primary key, tname char (4) NOT NULL, tsex char (2) NOT NULL, tbirthday date, prof Char (6), depart varchar (+) NOT NULL) GO CREATE TABLE Course (cno char (5) primary key, cname varchar (TEN) n OT nul
Three ways to transfer between pages: TEXT, JSON, XML.This chapter will explain the AJAX Web page transfer with the text situationFirst: Body part code Second: Click "Show Data" to use the chuli.php code The AJAX call returns the Strquery () function referenced by the stringThe AJAX call returns the string function strquery ($sql, $type =0, $ku = "MyDB") {$db =new mysqli ($this->host, $this->uid, $this- >pwd, $ku);! Mysqli_connect_error () or Die ("Connection Failed"), $result = $db->query
Data integrity can be divided into four categories.
1, Entity integrity, the purpose of entity integrity is to ensure that all entities in the database are unique, that is, should not appear exactly the same data records.2. Zone integrity, matching integrity requires that the data in the data table is within a certain allowable range.3, the reference integrity, is used to maintain data consistency between the relevant data table means, through the i
added.Descending can:Select as Average score from Resultgroup by studentnohaving avg (studentresult)>=Theorder by average DESC9.Check the exam time for the 2009-09-09 course's average pass scoreThis problem only needs to be limited in time to find out what you want:Select as Average score from Result where examdate>='2009-09-09 ' and examdate'2009-09-10 'GROUP by subjectidhaving AVG (studentresult)>=10.--statistics on at least one failing student number and number.Analysis of the problem
() over (order by Sal Desc) as num from emp) where numSELECT * FROM (select Ename,sal,row_number () over (order by Sal Desc) from EMP) where rownum--The top 3 wagesSELECT * from emp where Sal >=any (SELECT * FROM (select Sal to emp order by sal Desc) where rownumSELECT * FROM (SELECT * from emp ORDER BY sal Desc) where RowNum SELECT * FROM (select Ename,sal,empno,deptno, Row_number () Up (order by Sal Desc) from EMP) where rownumSELECT * FROM (select Ename,sal,empno,deptno, Row_number () Up (or
fromScore GROUP BY SNO have COUNT (*) >1) Group by Sno have COUNT (*) >1)
the
the-- +, the query score is higher than the school number as "109"And the course number is"3- the"All records of the scores. the SelectSno,cno,degree fromScorewhereDegree > (SelectDegree fromScorewheresno=109and cno='3-105')
-
the-- A, inquiry and study number 108 students of the same year were born of all students Sno, sname and Sbirthday column. the SelectSno,sname,sbirthday fromStudentwhereYear (sbirthday)
The following exercises have the default table in the Oracle database as the Principal1. List all departments that have at least one employee.SELECT DISTINCT d.dname from EMP e,dept D WHERE e.deptno=d.deptno;SELECT * from DEPT WHERE DEPTNO in (SELECT DISTINCT DEPTNO from EMP);SELECT DISTINCT d.dname from EMP E JOIN DEPT D USING (DEPTNO);2. List all employees who pay more than "SMITH". (Greater than the maxi
the names of students with average scores above 80 (inclusive).Select Sname from StudentWhere Sno in(Select Sno from SCGROUP BY Sno have AVG (Grade) >=80)--h. Query the student's information for at least 95001 of all courses selected.Select SnameFrom studentWhere not Exists(SELECT * FROM SC Sc1Where Sno in (' 95001 ') and not Exists(SELECT * from SC where Sc.sno=student.sno and Sc1.cno=sc.cno))--------to increase the female classmate's "3" course performance by 10%.Update SC Set grade=grade*1.1
tid from teacher where tname like ' li% ') as B 6, inquiry did not learn the "cotyledons" teacher class students of the school number, name; Train of thought: First find "Li ping" teacher taught all the lessons ID received All student IDs selected for the class are filtered in the student table select * FROM student where SID is not in (select DISTINCT student_id from score where s core.course_id in (select CID from course left JOIN teacher on course.teacher_id = teacher.tid where tname = ' Li
Tags: using cin to build database character type PNG write digital alt completeDatabase Job 14--comprehensive exercises (ii.) Feedback situationfirst, the homework request retelling1, the creation of the database Cpxs, saved in the e-packing directory to their own school number + surname first letter (Arabic numerals + capital letters) to create a folder , the in
message list author default value is ' Youku ', set to non-empty ALTER TABLE Liuyan modify author varchar () Default ' Youku ' NOT null; 5. Delete the Isdelete field in the Liuyan table ALTER TABLE Liuyan drop isdelete; 6. Add >5 test data to the message table (for example:) INSERT into ' Liuyan ' VALUES (' 6 ', ' superscript ', ' Big Mao ', ' 2017-06-14 09:59:37 ', ' h ', ' 0 ');INSERT into ' Liuyan ' VALUES (' 7 ', ' oooo ', ' Ange good ', ' 2016-04-16 09:59:44 ', ' pig ', ' 0 ');INSE
Tags: style blog http io ar using SP for strongExercises for defining variables:Stored procedures:Stored procedures (stored procedure) are sometimes referred to as sproc. Stored procedures are stored in a database rather than in a separate file, with input parameters, output parameters, and return values.In a database, the process of creating stored procedures is the same as creating other objects, except f
(degree) from score) --43, inquiries and "Li June" with the sex of all the students of the sname. Select Sname from Student where ssex= (select Ssex from Student where Sname= ' Li June ') and sname! = ' Li June ' --44, inquiries and "Li June" with the same sex and classmates sname. Method One, select Sname from Student where Ssex in (select Ssex from Student where Sname= ' Li June ') and class = (select Class from St udent where Sname = ' Li June ') and Sname! = ' Li June ' Method Two, select S
faction
17. Find out who is the highest wage in the Wudang school
18. What is the average wage for each door?
19. Query the current martial arts in which the average wage is more than 8000 and in reverse order of wages
20. Query the 3rd data in the current people table to the 7th data
21. Find out which portals have no disciples
22. Query the Wudang faction who are the Disciples
23. Check the total wage of each door in reverse order
24. Delete the person with the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.