The document contains 10 questions regarding Transact-SQL queries on SQL Server databases. Each question provides a scenario and asks which T-SQL query should be used. The questions cover topics such as retrieving data in XML format, ranking students by average marks, retrieving the highest marks for each subject, creating indexed views, computed columns, and auditing column updates. Sample answers are provided for each question along with brief explanations or references.
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1Dan D'Urso
SQL202 Accelerated Introduction to SQL Using Microsoft SQL Server Module 1. Covers relational database concepts, basic select statements, filtering results, special operators, wildcards, sorting, removing duplicates and selecting the top values.
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/tt9w50A5g7u
Jeffrey will cover ways to avoid people thinking your code is bad, some common coding fallacies, and presents two case studies on rewriting bad SQL. The first case study contains three iterations of code written by the instructor, the second case study comes from an eCommerce site that had a great idea but horrible execution.
An introduction to SQL standard language for beginners and non-technical information people. Mostly covers SELECT statement using standard clauses, Joins, Sub-Queries and ...
Introduction to SQL (for Chicago Booth MBA technology club)Jennifer Berk
Introduction to SQL for MBA students, presented spring 2012 to the Chicago Booth technology club.
Why an MBA would want to know SQL, a sandbox to practice in, and the basics of SQL syntax so you can pull your own datasets to analyze.
SQL202.2 Accelerated Introduction to SQL Using SQL Server Module 2Dan D'Urso
Accelerated Introduction to SQL Using Microsoft SQL Server Module 2. Covers inner, outer and self joins, correlated and uncorrelated subqueries, unions, aggregate functions, calculated fields and grouping.
YouTube Link: https://youtu.be/zbMHLJ0dY4w
** MySQL DBA Certification Training: https://www.edureka.co/mysql-dba **
This Edureka video on 'SQL Basics for Beginners' will help you understand the basics of SQL and also sql queries which are very popular and essential.. In this SQL Tutorial for Beginners you will learn SQL from scratch with examples. Following topics have been covered in this sql tutorial.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1Dan D'Urso
SQL202 Accelerated Introduction to SQL Using Microsoft SQL Server Module 1. Covers relational database concepts, basic select statements, filtering results, special operators, wildcards, sorting, removing duplicates and selecting the top values.
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/tt9w50A5g7u
Jeffrey will cover ways to avoid people thinking your code is bad, some common coding fallacies, and presents two case studies on rewriting bad SQL. The first case study contains three iterations of code written by the instructor, the second case study comes from an eCommerce site that had a great idea but horrible execution.
An introduction to SQL standard language for beginners and non-technical information people. Mostly covers SELECT statement using standard clauses, Joins, Sub-Queries and ...
Introduction to SQL (for Chicago Booth MBA technology club)Jennifer Berk
Introduction to SQL for MBA students, presented spring 2012 to the Chicago Booth technology club.
Why an MBA would want to know SQL, a sandbox to practice in, and the basics of SQL syntax so you can pull your own datasets to analyze.
SQL202.2 Accelerated Introduction to SQL Using SQL Server Module 2Dan D'Urso
Accelerated Introduction to SQL Using Microsoft SQL Server Module 2. Covers inner, outer and self joins, correlated and uncorrelated subqueries, unions, aggregate functions, calculated fields and grouping.
YouTube Link: https://youtu.be/zbMHLJ0dY4w
** MySQL DBA Certification Training: https://www.edureka.co/mysql-dba **
This Edureka video on 'SQL Basics for Beginners' will help you understand the basics of SQL and also sql queries which are very popular and essential.. In this SQL Tutorial for Beginners you will learn SQL from scratch with examples. Following topics have been covered in this sql tutorial.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
AimTo give you practical experience in database modelling, no.docxsimonlbentley59018
Aim:
To give you practical experience in database modelling, normalization and writing SQL statements to query a relational database
Assignment Summary:
The project specification details provided in this document and you must use only given specifications to come up with your solution. Make appropriate assumptions where ever required.
Please make sure that your group must meet your lecturer/tutor at least twice to update the progress of your assignment.
Background Information for Sample Database Project:
Australian Manufacturing Company (AMC) requires a database system to manage their stores, employees, products, suppliers, patrons and orders.
The following information has been gathered about current business activities of AMC.
AMC has many stores in different cities across Australia. Each store has unique store number and other details like name, contact details (phone number, email address and fax number) and location details (postal address composed of street number, suburb, state and postcode).
There are many departments within each store, for example, HR, accounts, finance and sales etc. each department is uniquely identified by department number. AMC also records department title, phone number and email address.
Each store has a number of employees. Each department is supervised by a department supervisor and each store is managed by a store manager who both are employees of AMC. Each department has a single supervisor only i.e. the department supervisor is also the supervisor for all the employees work within that department.
Each employee is referenced by unique employee number, name (first and last names), address, mobile number, email, TFN, salary and joining date. An employee’s salary is recorded differently as per his or her employment type. Employees can be employed as fulltime or casual basis. For a fulltime staff, annual salary is recorded and hourly rate for a casual staff.
Each store creates payslips for all employees work in that store on a weekly basis. As a minimum payslip number, no of hours worked, employee detail, store detail and gross pay are recorded.
AMC sales different products like fashion, health, beauty, electronics etc. Each product is characterised by product number, name, brand, description and price.
Each product can be supplied by one or more supplier and each supplier can supply one or many products. AMC also keeps appropriate details of their suppliers.
Each store maintains an inventory of their products available for sale. The quantity of each product available in store and the quantity ordered are kept.
AMC patron visits the store and shops in the store. Each customer is characterised by customer number, name (first and last names), mobile number and address.
A patron may place orders. An order contains one or many products at a time. A store keeps track of order number, order date, product(s) ordered and quantity ordered for each product.
2 | P a g e
The proprietors of AMC have ap.
http://www.it-exams.fr/70-469.htm Les exercices et corrigés du livre de référence Microsoft 70-469 seront renouvelés à temps pour suivre l’évolution de l’examen Microsoft 70-469 (TS:Recertification for MCSE: Data Platform)Notre ouvrage recouvre plus de 96% des connaissances nécessaires à l’examen Microsoft 70-469 (TS:Recertification for MCSE: Data Platform), ce qui vous permettra de bien réussir l’examen à la première tentative !
Produits similaires!
Developing Microsoft SQL Server 2012 Databases 70-464 Pass GuaranteeSusanMorant
In order to pass the Developing Microsoft SQL Server 2012 Databases 70-464 exam questions in the first attempt to support their preparation process with fravo.com Developing Microsoft SQL Server 2012 Databases 70-464. Your Developing Microsoft SQL Server 2012 Databases 70-464 exam success is guaranteed with a 100% money back guarantee.
For more details visit us today: https://www.fravo.com/70-464-exams.html
If you are using our Exam dumps then you will be able to get 100% guaranteed success in the real 1Z0-061 exam. Visit@ https://www.certmagic.com/1Z0-061-certification-practice-exams.html
#Oracle #Certifications #CertMagic #Learningmaterial #Practiceexams #Dumps #IT_Tech #Studyguide #FreeDemos #Discount #1Z0_061 #SQL #Fundamentals #Database
HOLMES
INSTITUTE
FACULTY
OF HIGHER
EDUCATION
UNDERGRADUATE
PROGRAM
Page 1 of 14
HS2021 Database Design and Use
Individual Assignment
Version 1
Assignment Value: 15% of your final mark
Due Date/Time: End of week 8 11:59PM (See Blackboard for submission deadline)
Submission Requirements
• Create a text file that contains all of the statements required for all tasks of this
assignment.
• Your scripts must work with Oracle Live SQL
• You must submit your assignment via Blackboard submission link by the due
date. (Note: Late submissions will attract a penalty)
• In week 8 Lab, you may request to demonstrate your assignment to your tutor.
Make sure that you have a soft copy of the script with you in the lab.
1. Section 1
A database analyst has developed the following ER Diagram:
Page 2 of 14
Create a script file named ASS1_SQL.TXT
Add your Student ID and Student name the first lines of the script file.
1.1. Relationships
Write the English sentences that best describe the ERD above.
• Place the text in the specified location in the file: ASS1_SQL.TXT
• Prefix each line with comment symbols -- (two hyphens)
E.g.: --ONE Employee MUST belong to ONE Branch
--ONE Branch MAY employ to MANY Employees
--ONE Branch MUST belong to ONE Organisation
-- ONE Organisation MAY employ to MANY Branches
1.2.Drop Tables
Write SQL DROP statements that will drop all the tables.
Add these statements to the appropriate location within the script file.
Page 3 of 14
1.3. Create Tables
Write SQL CREATE TABLE statements to create all the tables.
Add these statements to the appropriate location within the script file.
Note:
• All tables must have primary keys.
• All tables must have appropriate foreign key constraints.
• Each foreign key column must have identical column name, data type and size of the
primary key that it refers to
• Add any NOT NULL constraints as dictated by the ERD
• The following columns data types and sizes must be used
custid, prodid, ordid, spid number(4)
cfirstname, csurname, billingaddress,
deliveryaddress, prodname, spfirstname,
spsurname
varchar(30)
cgender, spgender varchar(1)
qtysold, qtydelivered number(4)
saleprice, currentprice number(6,2)
The following constraints must be used
Type Details
Check Gender values must be M or F
Check Prices must be in the range 0 to 5000
Check Quantities must be in the range 0 - 99
Foreign Key All foreign keys must have
named constraints
Page 4 of 14
1.4. Insert Customers
Write SQL INSERT statements that add the data shown to the CUSTOMER table.
Add these statements to the appropriate location within the script file.
ID Name Gender Bill Address
1 Casey Cartwright F 1 High St Kew
2 Evan Chambers M 8 Red St Rye
3 Calvin Owens M 7 .
Clauses in Sql(Structured Query Language), distinct clause, where clause, where clause, order by clause, group by clause, having clause, Relational Database Management System
on SQL Managment studio(For the following exercise, use the Week 5.pdfformaxekochi
on SQL Managment studio
(For the following exercise, use the Week 5 DB Design Excel file. Place the completed file in the
zip folder with your .sql files)
A landscaping firm has tasked you with developing a database for their company. You have
gathered requirements and have come up with the following list of data elements to construct a
basic data structure:
Client name Invoice number Equipment description
Invoice date Job description Payment total
Client city Equipment purchase date Employee name
Invoice total Client address
Client phone Employee payrate
Client zip code Client state
a. Using the DB Design Excel file, do the following:
Name the tables using the drop down menu above each table grid
Add the appropriate fields to each table using the drop down menus within the fields of each
table
Choose the correct data type for each field using the drop down menus within the data type
column next to the field.
Example:
(Vendors) (Invoices) (InvoiceLineItems) VendorID InvoiceID InvoiceSequence
VendorName VendorID (FK to Vendors) InvoiceID (FK to Invoices)
VendorAddress InvoiceDate InvoiceLineItemAmount
VendorAddress2 InvoiceTotal
VendorCity
New Database:
Create a new database named Finances.
Write a script that creates the following tables with the listed attributes. Reference foreign keys
where indicated. Be sure to create the tables in order of their dependencies (if you attempt to
create a table with a reference to another table that hasn’t been created, the script will fail).
Register table
RegisterID INT PK IDENTITY NOT NULL
TransactionID
Transactions table INT FK NOT NULL
TransactionID INT PK IDENTITY NOT NULL
AccountID VARCHAR(25) FK NOT NULL
TransactionDate SMALLDATETIME NOT NULL
TransactionAmount
Account table MONEY NOT NULL
AccountID VARCHAR(25) PK NOT NULL
AccountName VARCHAR(50) NOT NULL
AccountAddress VARCHAR(30) NULL
AccountCity VARCHAR(25) NULL
AccountState CHAR(2) NULL
AccountZip VARCHAR(10) NULL
AccountPhone VARCHAR(14) NULL
Create a database diagram of the Finances database. Take a screenshot of the diagram and save
it as a png file.
if you receive an error message informing you that you don’t have permission for the database,
run the following query:
ALTER AUTHORIZATION ON DATABASE::Finances TO sa
GO
Write a script that creates non-clustered indexes on the foreign keys in the Register and
Transactions tables.
Write an ALTER TABLE statement that adds check constraints to the following columns (use
NOCHECK):
AccountPhone (NOT NULL)
TransactionAmount ( > 0 )
Write an ALTER TABLE statement that adds the follow columns to these tables:
Register table:
ReferenceNo
Transactions table: VARCHAR(15) NULL
TransactionType VARCHAR(15) NOT NULL
TransactionCredit BIT NULL
In the Object Explorer, do the following
Expand the Finances database
Expand the Tables folder
Expand each table
Expand the Columns folder for each table
Expand the Constraints folder for the Account and Transactions tables
Expand the Indexes folder for the Register and Tr.
Similar to Microsoft MCSA 70-457 it exams dumps (20)
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Thesis Statement for students diagnonsed withADHD.ppt
Microsoft MCSA 70-457 it exams dumps
1. www.it-exams.fr original question and answer
Code:70-457
Titre: Transition Your MCTS on
SQL Server 2008 to MCSA:
SQL Server 2012, Part 1
Version: Demo
2. www.it-exams.fr original question and answer
QUESTION: 1
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are
defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the
CustomerId value set to 1 in the following XML format.
<row OrderId= "1" orderDate="2000-01-01T00:00:00", Amount="3400.00"
Name="Customer A" Country="Australia" />
<row OrderId="2" OrderDate="2001-01-01T00:00:00" Amount="4300.00"
Name="Customer A" Country-"Australia" />
Which Transact-SQL query should you use?
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW, ELEMENTS
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId - Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId
3. www.it-exams.fr original question and answer
WHERE Customers.CustomerId- 1
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,
OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Answer: A
Explanation: http://msdn.microsoft.com/en-us/library/bb510464.aspx
QUESTION: 2
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are
defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the
CustomerIdvalue set to 1 in the following XML format.
4. www.it-exams.fr original question and answer
Which Transact-SQL query should you use?
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers=CustomerId = 1
FOR XML RAW, ELEMENTS
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,
OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Answer: C
Reference: http://msdn.microsoft.com/en-us/library/ms188273.aspx
QUESTION: 3
5. www.it-exams.fr original question and answer
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are
defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the
CustomerId value set to 1 in the following XML format.
Which Transact-SQL query should you use?
Which Transact-SQL query should you use?
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW, ELEMENTS
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId - Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO
6. www.it-exams.fr original question and answer
F. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,
OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Answer: E
QUESTION: 4
You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables are
defined as shown in the exhibit. (Click the Exhibit button.)
You need to display rows from the Orders table for the Customers row having the
CustomerId value set to 1 in the following XML format.
7. www.it-exams.fr original question and answer
Which Transact-SQL query should you use?
A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW
B. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML RAW, ELEMENTS
C. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerId = Customers.CustomerId WHERE
Customers.CustomerId = 1
FOR XML AUTO
D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOIN
Customers ON Orders.CustomerXd - Customers.CustomerId WHERE
Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId WHERE
Customers.CustomerId- 1
FOR XML AUTO
F. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOIN
Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML AUTO, ELEMENTS
8. www.it-exams.fr original question and answer
G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,
OrderDate, Amount
FROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerId
WHERE Customers.CustomerId= 1
FOR XML PATH ('Customers')
Answer: D
QUESTION: 5
You create a table that has the StudentCode, SubjectCode, and Marks columns to record
mid-year marks for students. The table has marks obtained by 50 students for various
subjects.
You need to ensure that the top half of the students arranged by their average marks must
be given a rank of 1 and the remaining students must be given a rank of 2.
Which Transact-SQL query should you use?
A. SELECT StudentCode as Code,
RANK ( ) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
B. SELECT Id, Name, Marks, DENSE_RANK () OVER (ORDER BY Marks DESC) AS
Rank FROM StudentMarks
C. SELECT StudentCode as Code,
DENSE_RANK () OVER (ORDER BY AVG (Marks) DESC) AS Value FROM
StudentMarks GROUP BY StudentCode
D. SELECT StudentCode as Code,
NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
E. SELECT StudentCode AS Code,Marks AS Value
FROM (SELECT StudentCode, Marks AS Marks,
RANK () OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks)
tmp WHERE Rank = 1
F. SELECT StudentCode AS Code,Marks AS Value FRCM (SELECT StudentCode, Marks
AS Marks,
9. www.it-exams.fr original question and answer
RANK() OVER (PARTITION BY SubjectCode ORDER 3Y Marks DESC) AS Rank FRCM
StudentMarks)
tmp WHERE Rank = 1
G. SELECT StudentCode AS Code,Marks AS Value FROM (SELECT StudentCode,
Marks AS Marks,
RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks)
tmp WHERE Rank = 1
H. SELECT StudentCode AS Code,Marks AS Value FROM (SELECT StudentCode,
Marks AS Marks,
RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM
StudentMarks)
tmp WHERE Rank = 1
Answer: D
QUESTION: 6
You create a table that has the StudentCode, SubjectCode, and Marks columns to record
mid-year marks for students. The table has marks obtained by 50 students for various
subjects.
You need to ensure that the following requirements are met:
Students must be ranked based on their average marks. If one or more students have the
same average, the same rank must be given to these students.
Consecutive ranks must be skipped when the same rank is assigned.
Which Transact-SQL query should you use?
A. SELECT StudentCode as Code,
RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value
FROM StudentMarks
GROUP BY StudentCode
B. SELECT Id, Name, Marks,
DENSE_RANK() OVER(ORDER BY Marks DESC) AS Rank
FROM StudentMarks
C. SELECT StudentCode as Code,
DENSE_RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
GROUP BY StudentCode
D. SELECT StudentCode as Code,
NTILE(2) OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks
10. www.it-exams.fr original question and answer
GROUP BY StudentCode
E. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
F. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
G. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
H. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
Answer: A
Reference:
http://msdn.microsoft.com/en-us/library/ms189798.aspx
QUESTION: 7
You create a table that has the StudentCode, SubjectCode, and Marks columns to record
mid-year marks for students. The table has marks obtained by 50 students for various
subjects.
You need to retrieve the students who scored the highest marks for each subject along
with the marks.
Which Transact-SQL query should you use?
A. SELECT StudentCode as Code, RANK() OVER(ORDER BY AVG(Marks) DESC) AS
Value
FROM StudentMarks
GROUP BY StudentCode
11. www.it-exams.fr original question and answer
B. SELECT Id, Name, Marks, DENSE_RANK() OVER(ORDER BY Marks DESC) AS
Rank FROM StudentMarks
C. SELECT StudentCode as Code, DENSE_RANK() OVER(ORDER BY AVG(Marks)
DESC) AS
Value
FROM StudentMarks
GROUP BY StudentCode
D. SELECT StudentCode as Code, NTILE(2) OVER(ORDER BY AVG(Marks) DESC) AS
Value
FROM StudentMarks
GROUP BY StudentCode
E. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
F. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
G. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
H. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,
Marks AS Marks,
RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM
StudentMarks) tmp
WHERE Rank = 1
Answer: F
QUESTION: 8
You use a Microsoft SQL Server 2012 database.
You need to create an indexed view within the database for a report that displays
Customer
Name and the total revenue for that customer.
12. www.it-exams.fr original question and answer
Which four T-SQL statements should you use? (To answer, move the appropriate SQL
statements from the list of statements to the answer area and arrange them in the correct
order.)
Answer:
13. www.it-exams.fr original question and answer
QUESTION: 9
You develop a Microsoft SQL Server 2012 server database that supports an application.
The application contains a table that has the following definition:
CREATE TABLE Inventory (
ItemID int NOT NULL PRIMARY KEY,
ItemsInStore int NOT NULL,
ItemsInWarehouse int NOT NULL)
You need to create a computed column that returns the sum total of the ItemsInStore and
ItemsInWarehouse values for each row.
The new column is expected to be queried heavily, and you need to be able to index the
column.
Which Transact-SQL statement should you use?
A. ALTER TABLE Inventory
ADD TotalItems AS ItemslnStore + ItemsInWarehouse
14. www.it-exams.fr original question and answer
B. ALTER TABLE Inventory
ADD TotalItems AS ItemsInStore + ItemsInWarehouse PERSISTED
C. ALTER TABLE Inventory
ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse) PERSISTED
D. ALTER TABLE Inventory
ADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse)
Answer: B
Reference: http://msdn.microsoft.com/en-us/library/ms174979.aspx
QUESTION: 10
You develop a Microsoft SQL Server 2012 database that contains a table named
Customers.
The Customers table has the following definition:
You need to create an audit record only when either the MobileNumber or HomeNumber
column is updated.
Which Transact-SQL query should you use?
A. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
IF COLUMNS_UPDATED (HomeNumber, MobileNumber)
- - Create Audit Records
B. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
15. www.it-exams.fr original question and answer
IF EXISTS( SELECT HomeNumber FROM inserted) OR
EXISTS (SELECT MobileNumber FROM inserted)
- - Create Audit Records
C. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
IF COLUMNS_CHANGED (HomeNumber, MobileNumber)
- - Create Audit Records
D. CREATE TRIGGER TrgPhoneNumberChange
ON Customers FOR UPDATE
AS
IF UPDATE (HomeNumber) OR UPDATE (MobileNumber)
- - Create Audit Records
Answer: D
Reference: http://msdn.microsoft.com/en-us/library/bb510663.aspx
Reference: http://msdn.microsoft.com/en-us/library/ms186329.aspx