First, the general inquiry
/* Query table Data */
SELECT * from STU
/* Remove the first 3 lines of data/
select * from Stu where rownum<=3
/* Fuzzy query/
SELECT * from Stu where stu_id like ' stu001% '
Description: The wildcard character "%" represents one or more characters, and the wildcard "_" represents one character.
/* alias */
Select stu_id as learning No. from STU
Ii. Joint Enquiries
* * Common Joint query/
SELECT STU. Stu_name, STU. Stu_age, KC. Kc_name from STU, KC where STU. Kc_no = KC. Kc_no
/* Joint Enquiry/
SELECT STU. Stu_name, STU. Stu_age, KC. Kc_name from STU INNER joins KC on STU. Kc_no = KC. Kc_no ORDER by STU. stu_id
/* Left connection */
SELECT STU. Stu_name, STU. Stu_age, KC. Kc_name from STU left JOIN KC on STU. Kc_no = KC. Kc_no ORDER by STU. stu_id
/* Right Connection */
SELECT STU. Stu_name, STU. Stu_age, KC. Kc_name from STU right joins KC on STU. Kc_no = KC. Kc_no ORDER by STU. stu_id
/* Full connection/
SELECT STU. Stu_name, STU. Stu_age, KC. Kc_name from STU full JOIN KC on STU. Kc_no = KC. Kc_no ORDER by STU. stu_id
/*union keyword, combining two table certain fields * *
select stu_name from STU UNION select Kc_name from KC