Oracle Learning Path-SQL-Preliminary data

Source: Internet
Author: User

Start turning to Oracle and record your learning journey

Let's create some tables:

---------------//////Create student Table create table student (  SNO VARCHAR2)  primary  KEY,  SNAME VARCHAR2 (+),   sage number (2),   SSEX VARCHAR2 (5));--- ----------/////////Create a teacher table Create table teacher (TNO VARCHAR2)  primary key,tname  VARCHAR2);------------ //////Create a curriculum create table course (CNO VARCHAR2),cname  VARCHAR2 (TNO VARCHAR2),,constraint pk_course primary key  (Cno,tno));----------- -----//////to create the selected timetable CREATE TABLE SC (SNO VARCHAR2), Cno varchar2 (Score number), constraint pk_sc primary key  (SNO,CNO));------------------/////////////Operations/******* initialize data for student tables /insert into student values  (' s001 ', ' Zhang San ', 23, ' Male ');insert into student  values  (' s002 ', ' John Doe ', 23, ' Male ');insert into student values  (' s003 ', ' Peng Wu ', 25, ' Male '); insert  into student values  (' s004 ', ' Qin Qin ', 20, ' female ');insert into student values  (' s005 ', ' Wang Li ', 20, ' female ') ;insert into student values  (' s006 ', ' Li Bo ', 21, ' Male '); insert into student values   (' s007 ', ' Christina ', 21, ' Male ');insert into student values  (' s008 ', ' Shang ', 21, ' female ');insert  into student values  (' s009 ', ' Chen Yixiao ', 23, ' female ');insert into student values  (' s010 ', ' Vanessa Mae ', 22, ' female '); commit;/****************** initializing teacher table ***********************/insert into teacher  values  (' t001 ',  ' Liu Yang ');insert into teacher values  (' t002 ',  ' Shanyan '); insert  into teacher values  (' t003 ',  ' Humingshing '); commit;/*************** Initialize curriculum ******************* /insert into course values  (' c001 ', ' j2se ', ' t002 '); insert into course  values  (' c002 ', ' java web ', ' t002 ');insert into course values  (' c003 ', ' SSH ', ' t001 '); insert into course values  (' c004 ', ' Oracle ', ' t001 ');insert into course values  (' c005 ', ' Sql server 2005 ', ' t003 ');insert into course values  (' c006 ', ' C # ', ' t003 '); insert  into course values  (' c007 ', ' JavaScript ', ' t002 '); insert into course values   (' c008 ', ' div+css ', ' t001 ');insert into course values  (' c009 ', ' PHP ', ' t003 '); insert  into course values  (' c010 ', ' EJB3.0 ', ' t002 '); commit;/*************** Initialization score Table **************** /insert into sc values  (' s001 ', ' c001 ', 78.9); insert into sc values   (' s002 ', ' c001 ', 80.9);insert into sc values  (' s003 ', ' c001 ', 81.9); Insert into  sc values  (' s004 ', ' c001 ', 60.9);insert into sc values  (' s001 ', ' c002 ', 82.9); insert into sc values  (' s002 ', ' c002 ', 72.9);insert into sc values  (' S003 ', ' c002 ', 81.9); insert into sc values  (' s001 ', ' c003 ', ' I '); commit; 


Oracle Learning Path-SQL-Preliminary data

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.