SQL Queries
Specify the following SQLite queries on the chinook
You can access the database online through your web browser at the SQLite Tutorial, or you can download the chinook.db database from the tutorial site and run it on a labnet machine or your own machine. SQLite is already installed on labnet machines.
You must submit typed queries, not handwritten ones, and save them in a .pdf document. There is no need to submit the output (results).
Each query is worth 1 mark, but some are more difficult than others.
Queries to Specify
5. List the customer id, last name and email address of all customers with a Yahoo or Hotmail email address.
6. List the album id and number of tracks for all albums with 15, 16 or 17 tracks, in descending order of the number of tracks.
7. Find the maximum track length in milliseconds.
8. List the last name, first name and hire date of all employees born in 1961 to 1969 inclusive
9. List the genre name and count of all tracks in each genre, in descending order of track count (so the genre with the most tracks is listed first)
10. List the customer id, customer's last name, customer email and support rep's last name for all customers who live in Canada.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Create an SQLite Database as follows: A table called “Product” with the fields: _id, Name, StockOnHand, StockInTransit, Price, ReorderQuantity, ReorderAmount. StockOnHand – this represents how many of a Product is currently in the Warehouse/Store. StockInTransit – this represents how many of a Product has been ordered and is on its way, not yet received. Price – this is the cost of a Product. ReorderQuantity – this is the number at which stock levels must reach before a purchase order must be made. If StockOnHand is less than ReorderQuantity + StockInTransit, then a purchase order is necessary. ReorderAmount – this is the amount to be purchased when a reorder is made.arrow_forwardIntegrate Python Database Connectors with SQLite3 For this assignment, I will like you to do the following. Create a database called employees. The table should contain first name, last name, age, date of hire, and salary of the employees. You should run various SQL statement using SQLite3. I am looking for the following. 1) Create table 2) Insert employee 3) Update employee 4) Delete employee 5) Delete table.arrow_forwardHi good day i'm getting this error when trying to access localhost for my database. is there any way this can be fixed. if so can you assist in a step by step format? it would help a lot thanks. if you require any more information please let me know. Also please see the code attached Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1049] Unknown database 'car_sales_db' in C:\xampp\htdocs\Tutorial\config.php:19 Stack trace: #0 C:\xampp\htdocs\Tutorial\index.php(2): require() #1 {main} thrown in C:\xampp\htdocs\Tutorial\config.php on line 19arrow_forward
- In this question consider you are working on designing a mobile application for an Online store. Currently, you are storing product detail in the mobile local database. Now you suppose you have a complete contract class to store the following table.arrow_forwardThe MongoDB shell is an interactive ______interface to MongoDB. You can use the mongo shell to query and update data as well as perform administrative operations. A. NodeJS B. JavaScript C. C D. SQLarrow_forwardSubmit Result Key Here.. Subm SQL Injection Escaping Challenge To complete this challenge, you must exploit SQL injection flaw in the following form to find the result key. The developer of this level has attempted to stop SQL Injection attacks by escaping apostrophes so the database interpreter will know not to pay attention to user submitted apostrophes Challenge Hint This is the query you are injecting code into! Be aware that your apostrophes are being escaped with a leading backslash before being sent to the interpreter SELECT FROM customers WHERE customerld =" Please enter the Customer Id of the user that you want to look up Get user There were no results found in your searcharrow_forward
- Written in PHParrow_forwardsql queries Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a query in SQL to display the Entire data of All those employees whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of all those employees who earn morethan 50,000 per month Write a query in SQL to display the minimum, maximum salary and DEPARTMENT_NAMEof all those departments whose minimum salary is greater than 4000 in ascending order.arrow_forwardWrite Two CREATE USER Statements for the Publisher -Author - Books - Marketing: Database -- drop the database Publisher -Author - Books - MarketingDB if it already exists DROP DATABASE IF EXISTS PublisherAuthorBooksMarketingDB; -- create a database with name Publisher -Author - Books - MarketingDB CREATE DATABASE IF NOT EXISTS PublisherAuthorBooksMarketingDB; -- ensure that the database is used USE PublisherAuthorBooksMarketingDB; -- create the table for Publisher DROP TABLE IF EXISTS Publisher; CREATE TABLE IF NOT EXISTS Publisher ( pid VARCHAR(25), pubName VARCHAR(50), email VARCHAR(50), address VARCHAR(50), phone VARCHAR(15), CONSTRAINT Publisher_PK PRIMARY KEY(pid) ); -- create the table for Author DROP TABLE IF EXISTS Author; CREATE TABLE Author( socSecNum VARCHAR(15), authName VARCHAR (50), phone VARCHAR (15), address VARCHAR (50), email VARCHAR (50), CONSTRAINT Author_PK PRIMARY KEY (socSecNum) ); -- create the table for Marketer…arrow_forward
- Part 2: PL/SQL By using PL/SQL create the following: 1- A procedure Proc_Insert(arg2,arg3..argn): When the procedure is executed, the value of the passed arguments will be inserted into a table of your database.Note(you have to use one of the created Sequences to generate a value to be inserted into a field of your table). 2- A Procedure Update_value(arg1,arg2): The procedure searches about arg1 value in a specific column of your table and changes the value of the searched item to be equals arg2. 3- A procedure called del_Record_from_Table(arg1) that deletes a specific row from one of the tables you created. 4- A Function getAllData(arg): When Your call your function it should search about an item in your table and returns all data about it. 5- A row type trigger that's fires to accept the deleted rows from a table on your database and store them into another table. -You must create a new table to accept the deleted rows. - The new table must contain two additional columns, the first…arrow_forwardDatabase: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardCreate an application which can access a database. Create a database with an application user, user specific for your application to use, and 1 table of a couple of fields properly indexed. Grant permissions for the user to access the table. (submit .SQL file) Create a simple application, language of your choice, (BE languages only, no JS or Node) which can do the following operations: (submit source code file): Connect using the application user created above. Insert into the table, and select from the table using a WHERE clause, where all fields are parameterized. Display results of the select. Use a simple web server API interface for data input and output, which can be accessed via local browser or curl.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY