Question

In: Computer Science

Using your downloaded DBMS (MS SQL Server or MySQL), write SQL queries that inserts at least...

Using your downloaded DBMS (MS SQL Server or MySQL), write SQL queries that inserts at least three rows in each table.

    1. For the On-Demand Streaming System,
      1. First, insert information for multiple users, at least three video items and insert the three different types of subscriptions (Basic, Advanced, Unlimited) into the database.
      2. Then insert at least three user subscriptions.
  1. Execute the queries and make sure they run correctly

Solutions

Expert Solution

We will use the sales.promotions table created in the previous tutorial for the demonstration.

If you have not yet created the sales.promotions table, you can use the following CREATE TABLE statement:

 

CREATE TABLE sales.promotions ( promotion_id INT PRIMARY KEY IDENTITY (1, 1), promotion_name VARCHAR (255) NOT NULL, discount NUMERIC (3, 2) DEFAULT 0, start_date DATE NOT NULL, expired_date DATE NOT NULL );

1) Inserting multiple rows example

The following statement inserts multiple rows to the sales.promotions table:

 

INSERT INTO sales.promotions ( promotion_name, discount, start_date, expired_date ) VALUES ( '2019 Summer Promotion', 0.15, '20190601', '20190901' ), ( '2019 Fall Promotion', 0.20, '20191001', '20191101' ), ( '2019 Winter Promotion', 0.25, '20191201', '20200101' );

SQL server issued the following message indicating that three rows have been inserted successfully.

 

(3 rows affected)

Let’s verify the insert by executing the following query:

 

SELECT * FROM sales.promotions;


Related Solutions

Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based...
Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based on your entities defining The attributes within each table The primary and foreign keys within each table *****Show your database tables, tables attributes, primary and foreign keys***** Do not forget to check the lesson slides and videos that show you how to convert an ER/EER into a database schema, and how to create a database and tables using MS SQL Server.
Write the following SQL queries and show the corresponding output of the DBMS: 1) Write an...
Write the following SQL queries and show the corresponding output of the DBMS: 1) Write an SQL statement to display all the information of all Nobel Laureate winners. 2) Write an SQL statement to display the string "Hello, World!". 3) Write an SQL query to display the result of the following expression: 2 * 14 +76. 4) Write an SQL statement to display the winner and category of all Laureate winners. 5) Write an SQL query to find the winner(s)...
What are the keywords available in MS Access to use in SQL queries to enforce these...
What are the keywords available in MS Access to use in SQL queries to enforce these data integrity constraints? Discuss these with proper SQL queries.
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a...
Write the SQL queries that accomplish the following tasks using the AP Database 9. Write a select statement to show the invoicelineitemdescriptions that have the total invoicelineitemamount >1000 and the number of accountno is >2. 10. Write a select statement that returns the vendorid, paymentsum of each vendor, and the number of invoices of each vendor, where paymentsum is the sum of the paymentotal column. Return only the top ten vendors who have been paid the most and the number...
6-Microsoft SQL Server is a​ ________ for large mainframes and midrange computers. A.SimpleDB B.MongoDB C.relational DBMS...
6-Microsoft SQL Server is a​ ________ for large mainframes and midrange computers. A.SimpleDB B.MongoDB C.relational DBMS D.NoSQL E.distributed database 16-SQL stands for​ ________. A.Structured Query Language B.Streamlined Question Language C.Structured Question Language D.Special Question Language E.Structured Questioning Language 18-Which of the following is a distributed database technology that enables firms and organizations to create and verify transactions on a​ peer-to-peer network nearly instantaneously without a central​ authority? A.MySQL B.DB2 C.NoSQL D.Blockchain E.Cloud Spinner 19-What makes a Blockchain system possible and...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find the Content and the Reviewer Name for each comment, about “ACADEMY DINOSAUR” only if the same reviewer has commented about “ACE GOLDFINGER” too. 2) Retrieve the title of all the Movies in Japanese without any comment, ordered alphabetically. 3) Find all the movie titles where an actor called “TOM” or an actor called “BEN" acted, where there...
Design and implement a relational database application of your choice using MS Workbench on MySQL a)...
Design and implement a relational database application of your choice using MS Workbench on MySQL a) Declare two relations (tables) using the SQL DDL. To each relation name, add the last 4 digits of your Student-ID. Each relation (table) should have at least 4 attributes. Insert data to both relations (tables); (15%) b) Based on your expected use of the database, choose some of the attributes of each relation as your primary keys (indexes). To each Primary Key name, add...
In this assignment, you are required to write the SQL statements to answer the following queries...
In this assignment, you are required to write the SQL statements to answer the following queries using PostgreSQL system. The SQL statements comprising the DDL for Henry Books Database are given to you in two files. For that database, answer the following queries. Create the files Q1 to Q10 in PostgreSQL. Do follow the restrictions stated for individual queries. 1. List the title of each book published by Penguin USA. You are allowed to use only 1 table in any...
a) What are the most important differences between MS Access and as Server database like SQL...
a) What are the most important differences between MS Access and as Server database like SQL Server? b) Does Access have any advantages over SQL Server? c) Describe one or more scenarios where you would recommend upgrading an existing MS Access application to SQL Server. Not the use of SQL Server Express edition.
Basic SQL Use the following schema to answer the queries below using SQL DEVICE [dno, dtype,...
Basic SQL Use the following schema to answer the queries below using SQL DEVICE [dno, dtype, price] PROVIDER [pno, pname, web] SERVICE [dno, pno, servicedate] SERVICE.dno references DEVICE.dno SERVICE.pno references PROVIDER.pno bold is underline. a) Find the dno for the most expensive device b) Find all providers that have the work fast in the name c) Find the number of different device types (dtype) d) Give all details of devices with price more than $400
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT