EXERCISES: 1- Provide 3 benefits of saving on the server with a file or database
ID: 3689286 • Letter: E
Question
EXERCISES:
1- Provide 3 benefits of saving on the server with a file or database (as opposed to saving on the client side with cookies.
--------------------------------------------------------------------------------------------
2- Which of the following identifiers must not be used as a column name for your tables in an ASP.NET web application that uses transact-SQL? Hint: You should mark 4 identifiers as invalid. avg balance current_date degrees desc last prev_year weight
---------------------------------------------------------------------------------------------
3- In creating a table, what is the SQL syntax for specifying CountryCode and Id as the columns that comprise a primary key. Use good style.
--------------------------------------------------------------------------------------------
4- In a SELECT statement, what keyword should you use to retrieve results where there are no duplicate rows?
5-9. In the following 5 questions, use the following table. For all your answers, use good style.
Id
Name
Salary
10
Mickey Mouse
48000.00
11
Donald Duck
60000.00
12
Wile E. Coyote
45000.00
--------------------------------------------------------------------------------------------
5- Provide SQL code that creates the above table with an auto-increment Id column. Assume that before your SQL code executes, the table does not exist. After your code executes, the table should exist and be empty.
--------------------------------------------------------------------------------------------
6- Provide SQL code that displays the Id and Name of all people in the Employees table whose salary is greater than $50,000.
--------------------------------------------------------------------------------------------
7- Using the above three-row Employees table , what happens when the following statement executes?
INSERT INTO Employees
(Name, Salary)
SELECT 'Bugs Bunny', AVG(Salary)
FROM Employees
--------------------------------------------------------------------------------------------
8- Provide SQL code that changes the Name of all people in the Employees table to “Goofy” whose name has “ck” in it. Our book describes how you can match a string (such as “ck”).
--------------------------------------------------------------------------------------------
9- Provide SQL code that deletes all people in the Employees table whose id is less than 11 and whose salary is less than $50,000.
Id
Name
Salary
10
Mickey Mouse
48000.00
11
Donald Duck
60000.00
12
Wile E. Coyote
45000.00
Explanation / Answer
1.
2. The rules for the format of regular identifiers depend on the database compatibility level.
1. A letter as defined by the Unicode Standard 3.2. The Unicode definition of letters includes characters from a through z, from A through Z.
2. The underscore (_), at sign (@), or number sign (#). Certain symbols at the beginning of an identifier have special meaning in SQL Server.
3. Subsequent characters can include
1.Letters as defined in the Unicode Standard 3.2.
2.Decimal numbers from either Basic Latin or other national scripts.
3.The at sign, dollar sign ($), number sign, or underscore.
4.The identifier must not be a Transact-SQL reserved word. SQL Server reserves both the uppercase and lowercase versions of reserved words.
5. Embedded spaces or special characters are not allowed.
6.Supplementary characters are not allowed.
3. create table employees(countrycode int NOT NULL,id int NOT NULL , PRIMARY KEY (countrycode,id));
4. SELECT DISTINCT id,name,salry FROM employees ;
5. CREATE TABLE employees
(
ID int NOT NULL AUTO_INCREMENT,
Name varchar(255),
salary int);
6.select id ,name from employees where salary>$50,000
7.salary
48000
8. SELECT * FROM employees WHERE Name LIKE '%ck%';
9.delete name from employees where id<11 and salary< $50,000;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.