IT-FPX2230_LastFirst_Assessment4-Attempt1
.docx
keyboard_arrow_up
School
Capella University *
*We aren’t endorsed by this school
Course
2230
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
6
Uploaded by aralph1993
IT-FPX2230: Introduction to Database Systems
Weekly Solutions Submission Template
Name
: Angela Ralph
Date
: 2/4/24
Course
: IT-FPX2230 – Introduction to Database Systems
Assessment
: 3
Insert here a copy of your tee log file(s) of all of your SQL statements so that they could be unzipped, loaded, and run
in MySQL command line client: Insert here a copy of SQL statements text that you used here (copy and paste SQL statements here): -
use volunteers;
Database changed
- CREATE TABLE hours (
-> volunteerId int,
-> amountOfFunds int);
- DROP TABLE hours;
- CREATE TABLE hours (
-> volunteerId int,
-> hoursWorked int);
- CREATE TABLE funds (
-> volunteerId int,
-> amountOfFunds int);
- INSERT INTO funds VALUES (1, 100);
- INSERT INTO funds VALUES (2, 432);
- INSERT INTO funds VALUES (3, 28463);
- INSERT INTO funds VALUES (4, 284);
- INSERT INTO funds VALUES (5, 32847);
- INSERT INTO funds VALUES (6, 2384);
- INSERT INTO funds VALUES (7, 283);
- INSERT INTO funds VALUES (8, 28);
- INSERT INTO funds VALUES (9, 108);
- INSERT INTO funds VALUES (10, 2837);
- INSERT INTO hours VALUES (1, 10);
- INSERT INTO hours VALUES (2, 13);
- INSERT INTO hours VALUES (3, 5);
- INSERT INTO hours VALUES (4, 20);
- INSERT INTO hours VALUES (5, 23);
- INSERT INTO hours VALUES (6, 18);
- INSERT INTO hours VALUES (7, 16);
- INSERT INTO hours VALUES (8, 10);
- INSERT INTO hours VALUES (9, 10);
- INSERT INTO hours VALUES (10, 25);
- SELECT * FROM hours;
1
- SELECT * FROM funds;
- SELECT hours.volunteerId, hours.hoursWorked
-> FROM funds
-> JOIN hours ON funds.volunteerId = hours.volunteerId;
- SELECT amountOfFunds, hoursWorked
-> FROM funds
-> JOIN hours ON funds.volunteerId = hours.volunteerId
-> WHERE hoursWorked = 10;
- SELECT amountOfFunds, hoursWorked
-> FROM funds
-> JOIN hours USING (volunteerId);
Insert screenshot(s) showing the result running your SQL statements here: 2
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
The SQLiteOpenHelper and SQLiteCursor classes are described, with a focus on how they may be used to perform create, read, update, and delete (CRUD) actions on a SQLite database.
arrow_forward
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_forward
Web devvelopment and e-commerce question
arrow_forward
Computer Science
SQL Computer science question:
Write out a scenario where you would constrain and validate the user input to prevent a SQL injection attack. Explain what the input is, and write the code snippet showing how you validated it.
arrow_forward
True/False: Parallel processing in SQL can
improve query performance by utilizing
multiple threads.
arrow_forward
sql 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_forward
SQL 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 delete the record of all those cities where city name ends with b fromlocations table.
arrow_forward
SQL 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 DEPARTMENT_NAME of all those Departments whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of Physics department.
Write a Query in SQL to show the FIRST_NAME of all those employees whose salary is lessthan the salary of all those employees whose MANAGER_ID is 101 or 102.
arrow_forward
Please do not give solution in image format thanku
arrow_forward
LX SQLLuery1.sql - ML-RefVm-820127.AdventureWorks2017 (ML-RefVm-820127student (57))* - Microsoft SQL Server Management Studio (Administrator) File Edit View Query Project Tools Window Help
arrow_forward
Create an ERD in SQL with primary keys.
ReservationID
HotelID
HotelAddress
CheckInDate
LengthOfStay
RoomNumber
RoomCapacity
PoolInHotel
HotelManager
RatePerNightExclTaxExclDiscount
RateType
PercentDiscountOnRoomRate
RoomTaxPercent
RoomService
CustomerID
CustomerName
RewardsID
RewardsPointsEarned
DateOfLastStay
CustomeRatingOfStay
arrow_forward
in database using oracle.xe how to write SQL queries
arrow_forward
relation:
Book (BookID, Author, ISBN, Title)
Write a PL/SQL block of code that performs the following tasks:
Read a Book id provided by user at run time and store it in a variable.
Fetch the Author and title of the book having the entered id and store them inside two variables
Display the fetched book author and title.
arrow_forward
Solve C
I. This Project asks you to submit a SQL text file (e.g. project2.sql) with all your answers to all the questions listed in this assignment. Your answers will be written in SQL format. All SQL statements will be tested in a MySQL database including: CREATE TABLE, ALTER TABLE, INSERT and SELECT. You must use the following table structures for your MySQL DDL and DML commands:
STUDENT(StudentID, LastName, FirstName, Address, City, State, Zip, Phone)
StudentID will be automatically increased integer identifier
Choose VARCHAR or CHAR based on your personal understanding of the fields for the rest part of the relation/table
STUDENT_TEXTBOOK(StudentID, TextbookID, Class, Semester, Year)
Semester would be CHAR
Year would be integer
TEXTBOOK(TextbookID, Description, Price, Location, BookstoreID)
TextbookID will be automatically increased integer identifier
Price is a decimal with 2 decimal places after zero
Description and Location can be VARCHAR or CHAR based on your personal…
arrow_forward
PATHS is a table that contains information about paths on a number line. The
structure of PATHS is as follows, where x1 and x2 represent that there is a path
from Coordinate x1 to Coordinate x2 (You can't move from Coordinate x2 to
Coordinate x1 ).
NAME
ΤΥΡE
NULLABLE
X1
INT
FALSE
X2
INT
FALSE
Problem
Please write an SQL statement that returns the beginning and end point of each
path in PATHS . Sort them by the value of the beginning point in ascending order.
Constraints
• In the case where a direct path from Coordinate a to Coordinate b is
available, no path from Coordinate b to Coordinate a will be given.
|x1-x2| = 1
• No path will overlap with one another.
Example
Suppose that PATHS is as follows:
x1
x2
1
2
2
3
4
7
7
6
This table can be visualized as follows:
START
END
END
START
7
8.
9
Therefore, your SQL statement must return the following:
start
end
1
4
8
6
arrow_forward
31-Create a SQL statement to Display the number of clients for each CType with having less than 2 clients in the CLIENTS table.
arrow_forward
You are in charge of creating a small database for a store that sells goods so that it can keep track of its customers and their orders.
Write an SQL statement to create a customer table containing the following information:
Every customer has a unique ID, that should not be empty and set as the primary key
The customer's first and last name that shouldn't be empty
The phone number that shouldn't be empty
The email, which could be empty.
The address, which could be empty.
Write a SQL statement to create the table Orders, which will keep track of customer orders, using the following information:
Each order has a unique ID, which shouldn't be empty and should be set as the primary key.
The customer's ID and should not be empty and assign it as the foreign key of the customer ID in table customer.
The Items purchased by the customer and shouldn't be left empty.
The amount of each item, and should not be empty
The price of the items, and should not be empty
arrow_forward
Programming language: SQL
Tool: Oracle SQL Developer
The database schema
Employee (Lastname, FirstName, MidInitial, gender, street, city)
Works (Lastname, FirstName, MidInitial, company-name, salary) company (company-name, city)
company (company-name, city)
Manages(Lastname, FirstName, MidInitial, ManagerLastname, MFirstName, MMidInitial, start-date)
Manages(Lastname, FirstName, MidInitial, ManagerLastname, MFirstName, MMidInitial, start-date)
employee_table (you should define three attributes for employee and manager names)
Name street city gender
--------------------------------------------------------
Anderson, Susan L 108th Omaha F
Brady, Dan L P street Lincoln M
Chen, Peter K 124th Omaha M
Clemson, Ann M O Lincoln F
Dale, Mary K 132th Omaha F
Gill, Mary L P street Lincoln F
Harrison, Susan…
arrow_forward
SQL Queries
Specify the following SQLite queries on the chinook database. A schema for the database is in the picture.
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…
arrow_forward
SQL Queries
Specify the following SQLite queries on the chinook database. A schema for the database is in the picture.
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
1. List the last name, postal code and country for all customers from Germany.
2. List the city and number of customers from each city.
3. List the customer id, last name and city for the first 20 customers, when they are ordered by last name ascending.
4. List the customer id, last name and company for all customers who have any company details recorded (the company attribute is not "null").…
arrow_forward
Table: Team Member
Primary key: Team MemberID
Team MemberID
1
2
3
Team MemberName
Joe Bloggs
Samantha Smith
Pete Ngwenya
Table: Task
Primary key: TaskID
Foreign key: Team MemberID
TaskID
1
2
3
Description
Build login screen
Implement inventory
management
Add logo to splahs 1
screen
TeamMemberEmail
joe@theoffice.com
sam@theoffice.com
pete@theoffice.com
Duration StartDate
Team MemberID
2022-05-06
1
2022-05-15 1
4
10
2022-05-06 2
arrow_forward
Program language: SQLite
Table syntax:
CREATE TABLE Author( aid INTEGER PRIMARY KEY, name TEXT NOT NULL, certifications TEXT NOT NULL, bio TEXT NOT NULL);
CREATE TABLE Course( number TEXT PRIMARY KEY, title TEXT NOT NULL, length INTEGER NOT NULL);
CREATE TABLE CourseTopic( number TEXT, tid INTEGER PRIMARY KEY, FOREIGN KEY(number) REFERENCES Course(number), FOREIGN KEY(tid) REFERENCES Topic(tid));
CREATE TABLE Topic( tid INTEGER PRIMARY KEY, name TEXT NOT NULL, length INTEGER NOT NULL, subjectArea TEXT NOT NULL, aid INTEGER NOT NULL , FOREIGN KEY(aid) REFERENCES Author(aid));
Task:
Construct at least one trigger to either manage a constraint, a derived attribute, or create an audit trail. Update the database if necessary. Which trigger you create and on which table is your choice, but in your submission explain why you built that trigger and what its intended purpose is.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Related Questions
- The SQLiteOpenHelper and SQLiteCursor classes are described, with a focus on how they may be used to perform create, read, update, and delete (CRUD) actions on a SQLite database.arrow_forwardCreate 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_forwardWeb devvelopment and e-commerce questionarrow_forward
- Computer Science SQL Computer science question: Write out a scenario where you would constrain and validate the user input to prevent a SQL injection attack. Explain what the input is, and write the code snippet showing how you validated it.arrow_forwardTrue/False: Parallel processing in SQL can improve query performance by utilizing multiple threads.arrow_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_forward
- SQL 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 delete the record of all those cities where city name ends with b fromlocations table.arrow_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 DEPARTMENT_NAME of all those Departments whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of Physics department. Write a Query in SQL to show the FIRST_NAME of all those employees whose salary is lessthan the salary of all those employees whose MANAGER_ID is 101 or 102.arrow_forwardPlease do not give solution in image format thankuarrow_forward
- LX SQLLuery1.sql - ML-RefVm-820127.AdventureWorks2017 (ML-RefVm-820127student (57))* - Microsoft SQL Server Management Studio (Administrator) File Edit View Query Project Tools Window Helparrow_forwardCreate an ERD in SQL with primary keys. ReservationID HotelID HotelAddress CheckInDate LengthOfStay RoomNumber RoomCapacity PoolInHotel HotelManager RatePerNightExclTaxExclDiscount RateType PercentDiscountOnRoomRate RoomTaxPercent RoomService CustomerID CustomerName RewardsID RewardsPointsEarned DateOfLastStay CustomeRatingOfStayarrow_forwardin database using oracle.xe how to write SQL queriesarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning