SQL_1.docx - Ex 1-1 Print a description of the Course...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
********************************** Ex 1-1 ************************************ Print a description of the Course table (use DESC Course). Use the SELECT statement to display the actual data. (Just a reminder – you will have to use “rearp.” in front of all the table names, since you are not the owner of these tables. So, you will have to type in rearp.Course instead of just Course in your query) SQL> DESC rearp.Course Name Null? Type ---------------------------- -------- ---------------------------- COURSE_NAME VARCHAR2(20) COURSE_NUMBER NOT NULL VARCHAR2(8) CREDIT_HOURS NUMBER(38) OFFERING_DEPT VARCHAR2(4) ********************************** Ex 1-2 ************************************ Create a synonym for the Student table. Display the table description using the synonym. Display all the data in the Student table using SELECT. SQL> CREATE SYNONYM stu FOR rearp.Student; Synonym created. SQL> DESC mmd24.stu Name Null? Type ----------------- -------- ---------------------------- STNO NOT NULL NUMBER(38) SNAME VARCHAR2(20) MAJOR VARCHAR2(4) CLASS NUMBER(38) BDATE DATE
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
SQL> Select * 2 From stu; STNO SNAME MAJOR CLASS BDATE ---------- ----------- ------------ ---------- --------------- 2 Lineas ENGL 1 15-APR-01 3 Mary COSC 4 16-JUL-98 8 Brenda COSC 2 13-AUG-97 48 rows selected ********************************** Ex 1-3 ************************************ Create synonyms for the tables in the Student- Course database because you will use them extensively. SQL> CREATE SYNONYM cou FOR rearp.Course; Synonym created. SQL> CREATE SYNONYM sec FOR rearp.Section; Synonym created. SQL> CREATE SYNONYM pre for rearp.Prereq; Synonym created. SQL> CREATE SYNONYM gr FOR rearp.Grade_report; Synonym created.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern