Database in omnymbus

Assignment Help PL-SQL Programming
Reference no: EM13835306

/*Using the STUDENT table in the MISLab1 database in Omnymbus, perform the following tasks: Note the first SELECT is there to label the output, DUAL is a "dummy" table. The second SELECT is the solution.

1. Write a SQL statement to display Student's First and Last Name.*/

SELECT ' Result 1 ' AS 'Result Table' from DUAL;

SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT;

/*2. Write a SQL statement to display the Major of the STUDENT with no duplications. Do not display student names.*/

SELECT ' Result 2 ' AS 'Result Table' from DUAL;

SELECT Distinct STUDENT.Major
FROM STUDENT;

/*3. Write a SQL statement to display the First and Last Name of students who live in the Zip code 82622. */

SELECT ' Result 3 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.ZIP ="82622";

/*4. Write a SQL statement to display the First and Last Name of students who live in the Zip code 97912 and have the major of CS.*/

SELECT ' Result 4 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.ZIP ="82622" AND STUDENT.MAJOR="CS";

/*5. Write a SQL statement to display the First and Last Name of students who live in the Zip code 82622 or 37311. Do not use IN.*/

SELECT ' Result 5 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.ZIP ="82622" OR STUDENT.ZIP ="37311";

/*6. Write a SQL statement to display the First and Last Name of students who have the major of Business or Math. Use IN.*/

SELECT ' Result 6 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.MAJOR IN ("Business","Math");

/*7. Write a SQL statement to display the First and Last Name of students who have the Class greater than 1 and less than 10. Use the SQL command BETWEEN. */

SELECT ' Result 7 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.CLASS BETWEEN 1 AND 10;

/*8. Write a SQL statement to display the First and Last Name of students who have a Last name that starts with an S.*/

SELECT ' Result 8 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.Last_Name LIKE "S%";

/*9. Write a SQL statement to display the First and Last Name of students having an a in the second position of their first names.*/

SELECT ' Result 9 ' AS 'Result Table' from DUAL;
SELECT STUDENT.First_Name , STUDENT.Last_Name
FROM STUDENT
WHERE STUDENT.First_Name LIKE '_a';

/*10. Write a SQL expression to display each Status and the number of occurrences of each status using the Count(*) function; display the result of the Count(*) function as CountStatus. Group by Status and display the results in escending order of CountStatus.*/

SELECT ' Result 10 ' AS 'Result Table' from DUAL;
SELECT STUDENT.STATUS, Count(*) AS CountStatus
FROM STUDENT
GROUP BY STUDENT.STATUS
ORDER BY CountStatus ASC;

Attachment:- iLab 1.txt

Attachment:- iLab1QueryScript.sql

Reference no: EM13835306

Questions Cloud

Ideal human behavioral organization : Ideal Human Behavioral Organization
Compare full-state feedback design vs classical design : compare the full-state feedback design vs. the classical design result using the results from 2).a & 2).b, describe the difference, pros & cons, etc.
What court system could the homeowner use : What court system could the homeowner use to resolve the problem? Explain what procedures the homeowner must follow, including what could the homeowner do if unsuccessful there (and possibly subsequent levels)
What do you think about criminal convictions : Class, what do you think about the repercussions regarding criminal convictions? Are they counterproductive to rehabilitation and reintegration
Database in omnymbus : /*Using the STUDENT table in the MISLab1 database in Omnymbus, perform the following tasks: Note the first SELECT is there to label the output, DUAL is a "dummy" table. The second SELECT is the solution.
What is intellectual property : What is intellectual property, and why have we derived this concept of property ownership? What do you think would happen innovation-wise if the concept of intellectual property didn't exist
Current divorce laws and gender-neutral criteria : Current divorce laws and gender-neutral criteria
Interstate commerce clause and federal civil rights statutes : The facilities include, amongst others, boat rentals, a par 3 golf course, pavilions for picnics and other gatherings, and a catering service. How, using the interstate commerce clause and federal civil rights statutes, might the restrictions be i..
Scenario-holliman veterinary hospital : Holliman Veterinary Hospital has considered advertising on the radio and in newspapers in their community, but now has contacted you about the possibility of developing a better Web presence.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd