Learn to Practice Java database query problems

Source: Internet
Author: User

Primary key: sno+ Cno
Table (iv) Teacher (Teacher's table)
Whether the property name data type can be null meaning
TNOVARCHAR2 (3) No faculty number (primary key)
TNAMEVARCHAR2 (4) No Faculty name
TSEXVARCHAR2 (2) No Faculty gender
Tbirthdaydate can be a faculty born
PROFVARCHAR2 (6) Available titles
Departvarchar (10) No Faculty Department
Table 1-2 data in the database
Table (i) Student
Snosnamessexsbirthdayclass
108 Zeng Hua male 1977-09-0195033
105 Kuanming Male 1975-10-0295031
107 Wang Liju 1976-01-2395033
101 Li June Male 1976-02-2095033
109 Wang Fang Female 1975-02-1095031
103 Contacts Male 1974-06-0395031

Table (ii) Course
Cnocnametno
3-105 Introduction to Computers 825
3-245 Operating System 804
6-166 Digital Circuit 856
9-888 Advanced Mathematics 831
Table (iii) score
Snocnodegree
1033-24586
1053-24575
1093-24568
1033-10592
1053-10588
1093-10576
1013-10564
1073-10591
1083-10578
1016-16685
1076-16679
1086-16681
Table (iv) Teacher
Tnotnametsextbirthdayprofdepart
804 Li Chengnan 1958-12-02 Associate Professor Computer Department
856 Zhang Xunan 1969-03-12 Lecturer, Department of Electronic Engineering
825 Wang Ping 1972-05-05 Assistant computer Department
831 Liu Bing 1977-08-14 teaching assistant, Department of Electronic Engineering

1. Query the sname, Ssex, and class columns of all records in the student table.


2, the inquiry teacher all units namely does not duplicate depart column.


3. Query all records of student table.


4. Query all records from 60 to 80 of the scores in the score table.


5. Check the record of 85, 86 or 88 in the score table.


6, inquires the student table "95031" class or the sex is "the female" the classmate record.


7. Query the student table for all records in descending order of class.


8, in CNO Ascending, Degree descending query score all records of the table.

9. Check the number of students in "95031" class.

Learn to Practice Java database query problems

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.