This document outlines topics related to database design, performance, and reporting using Microsoft SQL Server. The topics covered include database fundamentals, relational database objects, SQL Server design and architecture, database normalization, SQL, optimization techniques, and reporting tools. Database concepts such as tables, keys, indexes, and relationships are defined. The benefits of normalization for organizing data efficiently without redundancy are also discussed.
Here is the list of all important MySQL functions. Each function has been explained along with suitable example.
*
MySQL Group By Clause - The MySQL GROUP BY statement is used along with the SQL aggregate functions like SUM to provide means of grouping the result dataset by certain database table column(s).
*
MySQL IN Clause - This is a clause which can be used alongwith any MySQL query to specify a condition.
*
MySQL BETWEEN Clause - This is a clause which can be used alongwith any MySQL query to specify a condition.
*
MySQL UNION Keyword - Use a UNION operation to combine multiple result sets into one.
*
MySQL COUNT Function - The MySQL COUNT aggregate function is used to count the number of rows in a database table.
*
MySQL MAX Function - The MySQL MAX aggregate function allows us to select the highest (maximum) value for a certain column.
*
MySQL MIN Function - The MySQL MIN aggregate function allows us to select the lowest (minimum) value for a certain column.
*
MySQL AVG Function - The MySQL AVG aggregate function selects the average value for certain table column.
*
MySQL SUM Function - The MySQL SUM aggregate function allows selecting the total for a numeric column.
*
MySQL SQRT Functions - This is used to generate a square root of a given number.
*
MySQL RAND Function - This is used to generate a random number using MySQL command.
*
MySQL CONCAT Function - This is used to concatenate any string inside any MySQL command.
*
MySQL DATE and Time Functions - Complete list of MySQL Date and Time related functions.
*
MySQL Numeric Functions - Complete list of MySQL functions required to manipulate numbers in MySQL.
*
MySQL String Functions - Complete list of MySQL functions required to manipulate strings in MySQL.
This is my 75 minutes "highlights" presentation on what's new in WS2012 R2. It's not all encompassing - intended just to get across the key points of the core OS. It followed a "Cloud OS" keynote and preceded a "System Center hybrid cloud" presentation.
Dear Student,
Greetings from Etraining.guru.
We provide THE BEST DB2 LUW/UDB DBA training in the Industry by THE real time expert. Our Trainer comes with 10+ years of IT working experience on open systems of project team sizes ranging from 2 to 70+.
Course Highlights:
****************
(1) 32+ hours of course content:
http://www.etraining.guru/online-training-db2-luw-udb-dba.aspx
(2) 5 free classes on Unix & Shell scripting of topics of student's interest
(3) 10 hours of Free job support. Beyond these hours, job support is provided for a nominal charge of $10/hour
(4) Course fees: $400 for working professionals; $300 for students/job seekers
(5) Class Timing: Flexible, depending upon student's requirement
(6) Email: info@etraining.guru
Please feel free to let us know if any further details needed.
Thanks,
Bhavana
www.etraining.guru
Email:info@etraining.guru
June 17th & 18th 2015. FREE. Online. On-demand. On your device.
Over 60 sessions in 2 days. Starting at 11:00 EDT on the 17th June, SPBiz brings insights and knowledge to help your business benefit from SharePoint, wherever you are. If you want to get the most out of your SharePoint platform, this is THE conference for you. Free to attend as a delegate, bringing influential speakers and direction setters in the SharePoint community directly to your device.
Here is the list of all important MySQL functions. Each function has been explained along with suitable example.
*
MySQL Group By Clause - The MySQL GROUP BY statement is used along with the SQL aggregate functions like SUM to provide means of grouping the result dataset by certain database table column(s).
*
MySQL IN Clause - This is a clause which can be used alongwith any MySQL query to specify a condition.
*
MySQL BETWEEN Clause - This is a clause which can be used alongwith any MySQL query to specify a condition.
*
MySQL UNION Keyword - Use a UNION operation to combine multiple result sets into one.
*
MySQL COUNT Function - The MySQL COUNT aggregate function is used to count the number of rows in a database table.
*
MySQL MAX Function - The MySQL MAX aggregate function allows us to select the highest (maximum) value for a certain column.
*
MySQL MIN Function - The MySQL MIN aggregate function allows us to select the lowest (minimum) value for a certain column.
*
MySQL AVG Function - The MySQL AVG aggregate function selects the average value for certain table column.
*
MySQL SUM Function - The MySQL SUM aggregate function allows selecting the total for a numeric column.
*
MySQL SQRT Functions - This is used to generate a square root of a given number.
*
MySQL RAND Function - This is used to generate a random number using MySQL command.
*
MySQL CONCAT Function - This is used to concatenate any string inside any MySQL command.
*
MySQL DATE and Time Functions - Complete list of MySQL Date and Time related functions.
*
MySQL Numeric Functions - Complete list of MySQL functions required to manipulate numbers in MySQL.
*
MySQL String Functions - Complete list of MySQL functions required to manipulate strings in MySQL.
This is my 75 minutes "highlights" presentation on what's new in WS2012 R2. It's not all encompassing - intended just to get across the key points of the core OS. It followed a "Cloud OS" keynote and preceded a "System Center hybrid cloud" presentation.
Dear Student,
Greetings from Etraining.guru.
We provide THE BEST DB2 LUW/UDB DBA training in the Industry by THE real time expert. Our Trainer comes with 10+ years of IT working experience on open systems of project team sizes ranging from 2 to 70+.
Course Highlights:
****************
(1) 32+ hours of course content:
http://www.etraining.guru/online-training-db2-luw-udb-dba.aspx
(2) 5 free classes on Unix & Shell scripting of topics of student's interest
(3) 10 hours of Free job support. Beyond these hours, job support is provided for a nominal charge of $10/hour
(4) Course fees: $400 for working professionals; $300 for students/job seekers
(5) Class Timing: Flexible, depending upon student's requirement
(6) Email: info@etraining.guru
Please feel free to let us know if any further details needed.
Thanks,
Bhavana
www.etraining.guru
Email:info@etraining.guru
June 17th & 18th 2015. FREE. Online. On-demand. On your device.
Over 60 sessions in 2 days. Starting at 11:00 EDT on the 17th June, SPBiz brings insights and knowledge to help your business benefit from SharePoint, wherever you are. If you want to get the most out of your SharePoint platform, this is THE conference for you. Free to attend as a delegate, bringing influential speakers and direction setters in the SharePoint community directly to your device.
Microsoft Azure zmienia się. Jego częśc poświęcona bazie danych (Windows Azure SQL Database) zmienia się jeszcze szybciej. Podczas tej sesji chciałbym pokazac tym, którzy nie widzieli, oraz przypomniec tym, którzy już coś wiedzą - o co chodzi z WASD, jakie zmiany nastapiły i czego możemy po tej bazie oczekiwać. Dla odważnych będzie okazja podłączenia się do konta w chmurze i przetestowania ych rozwiązań samemu.
In this session, we will discuss how the new file server features in Microsoft Windows Server 2008 will help you more easily and reliably share your files on the network. We will review the new features of the File Server Role in Windows Server 2008 as well as talk about the new SMB 2.0 protocol, Transactional File IO, Server Backup, and the Storage Explorer. We will talk about using the new Offline Files feature to keep local and remote folders in sync, as well as taking a look at failover clustering. The session will round off by discussing istributed File System (DFS) and taking a look at the new replication features.
I would like you to join me on our journey from a complex, multi instance Oracle topology to a single logical database in PostgreSQL. Each technology and architectural decision point will be discussed describing how we arrived at our destination. There are five keys areas that will be covered: - Target architecture - Migration of database objects (tables, indexes, views, synonyms, etc) - Migration of database code (packages, functions, procedures, triggers) - Application tier - Migration of Data - with minimal downtime during cutover The target architecture is a BDR cluster, where the physical data model and data stored is different between the logical standbys and the lead master/shadow master. Will discuss how this allowed for the simplification of the topology, and the benefits this delivered. Before you go there, yes I know PostgreSQL does no have synonyms, but an alternative approach was needed. There is a significant amount of business logic in the database tier all of which needed to be translated into database code. Will look at the tools and extensions available to reproduce the functionality in PostgreSQL. Look at common non-ISO standard SQL embedded in the application tier, along with jdbc challenges. Finally a look at some of the data movement tools available. Full disclosure, we are still on the journey but have learnt a lot on the way.
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
The best code is the one you never need to write. Using code generation and automated builds you can minimize the risk of human error when developing software, but how do you maintain control over code when large parts of it is handed over to a machine? In this tutorial, you will learn how to use open-source software to create and control code automation. You will see how you can generate a completely object-oriented domain model by automatically analyzing your database schemas. Every aspect of the process is transparent and configurable, giving you as a developer 100% control of the generated code. This will not only increase your productivity, but also help you build safer and more maintainable Java applications.
Solving the DB2 LUW Administration DilemmaRandy Goering
As a DB2 LUW Database Administrator you are probably reluctant to or prohibited from granting your users* these permissions because doing so gives them permission to other DB2 administrations tasks like stopping the database. If your users are not allowed to do these tasks then who is? Most likely, you, as the DBA will perform these and other administrative functions for your users. Would you like a way to eliminate these tasks from your daily to-do list? This presentation will discuss how to externalize specific administrative tasks with Stored Procedures, Federated procedures, Administrative SQL routines, and views.
Microsoft Azure zmienia się. Jego częśc poświęcona bazie danych (Windows Azure SQL Database) zmienia się jeszcze szybciej. Podczas tej sesji chciałbym pokazac tym, którzy nie widzieli, oraz przypomniec tym, którzy już coś wiedzą - o co chodzi z WASD, jakie zmiany nastapiły i czego możemy po tej bazie oczekiwać. Dla odważnych będzie okazja podłączenia się do konta w chmurze i przetestowania ych rozwiązań samemu.
In this session, we will discuss how the new file server features in Microsoft Windows Server 2008 will help you more easily and reliably share your files on the network. We will review the new features of the File Server Role in Windows Server 2008 as well as talk about the new SMB 2.0 protocol, Transactional File IO, Server Backup, and the Storage Explorer. We will talk about using the new Offline Files feature to keep local and remote folders in sync, as well as taking a look at failover clustering. The session will round off by discussing istributed File System (DFS) and taking a look at the new replication features.
I would like you to join me on our journey from a complex, multi instance Oracle topology to a single logical database in PostgreSQL. Each technology and architectural decision point will be discussed describing how we arrived at our destination. There are five keys areas that will be covered: - Target architecture - Migration of database objects (tables, indexes, views, synonyms, etc) - Migration of database code (packages, functions, procedures, triggers) - Application tier - Migration of Data - with minimal downtime during cutover The target architecture is a BDR cluster, where the physical data model and data stored is different between the logical standbys and the lead master/shadow master. Will discuss how this allowed for the simplification of the topology, and the benefits this delivered. Before you go there, yes I know PostgreSQL does no have synonyms, but an alternative approach was needed. There is a significant amount of business logic in the database tier all of which needed to be translated into database code. Will look at the tools and extensions available to reproduce the functionality in PostgreSQL. Look at common non-ISO standard SQL embedded in the application tier, along with jdbc challenges. Finally a look at some of the data movement tools available. Full disclosure, we are still on the journey but have learnt a lot on the way.
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
The best code is the one you never need to write. Using code generation and automated builds you can minimize the risk of human error when developing software, but how do you maintain control over code when large parts of it is handed over to a machine? In this tutorial, you will learn how to use open-source software to create and control code automation. You will see how you can generate a completely object-oriented domain model by automatically analyzing your database schemas. Every aspect of the process is transparent and configurable, giving you as a developer 100% control of the generated code. This will not only increase your productivity, but also help you build safer and more maintainable Java applications.
Solving the DB2 LUW Administration DilemmaRandy Goering
As a DB2 LUW Database Administrator you are probably reluctant to or prohibited from granting your users* these permissions because doing so gives them permission to other DB2 administrations tasks like stopping the database. If your users are not allowed to do these tasks then who is? Most likely, you, as the DBA will perform these and other administrative functions for your users. Would you like a way to eliminate these tasks from your daily to-do list? This presentation will discuss how to externalize specific administrative tasks with Stored Procedures, Federated procedures, Administrative SQL routines, and views.
The java interview questions ebook - confused codersYash Sharma
This is a primer book for brushing up your java concepts before going to the interviews.
The book has been casually written by us for our friends attending java interviews.
We are sharing the book so that it can be beneficiary to other people over the internet.
Note: The book has been written casually and has not been thoroughly reviewed, hence if you find any bugs or errors please report us so that we can fix it ASAP.
Thanks, Happy Learning. Cheers.
What are the top 100 SQL Interview Questions and Answers in 2014? Based on the most popular SQL questions asked in interview, we've compiled a list of the 100 most popular SQL interview questions in 2014.
This pdf includes oracle sql interview questions and answers, sql query interview questions and answers, sql interview questions and answers for freshers etc and is perfect for those who're appearing for a linux interview in top IT companies like HCL, Infosys, TCS, Wipro, Tech Mahindra, Cognizant etc
This list includes SQL interview questions in the below categories:
top 100 sql interview questions and answers
top 100 java interview questions and answers
top 100 c interview questions and answers
top 50 sql interview questions and answers
top 100 interview questions and answers book
sql interview questions and answers pdf
oracle sql interview questions and answers
sql query interview questions and answers
sql interview questions and answers for freshers
SQL Queries Interview Questions and Answers
SQL Interview Questions and Answers
Top 80 + SQL Query Interview Questions and Answers
Top 20 SQL Interview Questions with Answers
Sql Server Interviews Questions and Answers
100 Mysql interview questions and answers
SQL Queries Interview Questions
SQL Query Interview Questions and Answers with Examples
Mysql interview questions and answers for freshers and experienced
Asp.net Programming Training (Web design, Web development)Moutasm Tamimi
Asp.net Programming Training (Web design, Web development)
Prepared By: Moutasm Tamimi
Using C# language
By Microsoft visual studio program
version 2008-2010-2012-2014
An Introduction To Software Development - Architecture & Detailed DesignBlue Elephant Consulting
This presentation is a part of the COP2271C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce Freshmen students to both the process of software development and to the Python language.
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
A video of Dr. Anderson using these slides is available on YouTube at:
https://youtu.be/PXYATve92zU
This presentation was given at the LDS Tech SORT Conference 2011 in Salt Lake City. The slides are quite comprehensive covering many topics on MongoDB. Rather than a traditional presentation, this was presented as more of a Q & A session. Topics covered include. Introduction to MongoDB, Use Cases, Schema design, High availability (replication) and Horizontal Scaling (sharding).
Odoo - Educational Account for Students and Teachers Ver. 2.0Naji El Kotob
Odoo is a suite of 45+ integrated business apps that help you grow your business. As a student or a teacher, this presentation will help you to open a free Odoo Educational Account.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
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.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
1. www.formatech.com.lb
Microsoft SQL Server
Design, Performance and Reporting
Version 1.4 - 08
.
By Naji El Kotob.
Certified Trainer
Information Technology Consultant
_______________________________
naji@dotnetheroes.com
2. Database
◦ Definitions and Fundamentals
◦ Relational Database Objects
◦ B-Tree
Microsoft SQL Server
◦ Design and Architecture
Database Design
◦ Relationships
◦ Database Normalization
SQL – Structured Query Language
◦ DML
◦ JOINS
Inner, Outer, Full, Cross and self
Optimization and Performance Tips
Microsoft SQL Server Development Tools
◦ Business Intelligence Development Studio
Resources and References
Outlines
By Naji El Kotob {naji@dotnetheroes.com}
4. An organized collection of data.
Database?
By Naji El Kotob {naji@dotnetheroes.com}
5. DEMO
◦ [Real Case Studies]
Database?
By Naji El Kotob {naji@dotnetheroes.com}
6. There are two main types of database;
flat-file and relational.
Database Types
By Naji El Kotob {naji@dotnetheroes.com}
7. RDBMS?
By Naji El Kotob {naji@dotnetheroes.com}
8. The "relation" comes from the fact that
the tables can be linked to each other.
Relational
By Naji El Kotob {naji@dotnetheroes.com}
9. DBMS is the software that controls the
organization, storage, retrieval, security
and integrity of data in a database.
DBMS [Database Management System]
By Naji El Kotob {naji@dotnetheroes.com}
10. A type of database management
system (DBMS) that stores data in the
form of related tables.
Source: http://www.webopedia.com
RDBMS
By Naji El Kotob {naji@dotnetheroes.com}
11. One major advantage of the relational
model is that, if a database is designed
efficiently, there should be NO duplication
of any data; helping to maintain database
integrity.
Customers
Orders
Relational Model
By Naji El Kotob {naji@dotnetheroes.com}
13. Database objects are tables, indexes,
views, triggers, procedures…
Database Objects
By Naji El Kotob {naji@dotnetheroes.com}
14. Tables are the basic component of a
relational database (RDB). It has a
number of rows and columns, similar to a
spreadsheet.
Database Tables
By Naji El Kotob {naji@dotnetheroes.com}
15. A database index is a data structure that
improves the speed of operations in a
table.
Indexes can be created using one or more
columns, providing the basis for both
rapid random lookups and efficient
ordering of access to records.
Database Index
By Naji El Kotob {naji@dotnetheroes.com}
25. Primary Filegroup
Data Log
.mdf .ldf
MSSQL: Design and Architecture
By Naji El Kotob {naji@dotnetheroes.com}
26. Primary Filegroup
Data
.mdf
New Filegroup
Data Log
Data
.ndf .ldf
.ndf
MSSQL: Design and Architecture (Cont’d)
By Naji El Kotob {naji@dotnetheroes.com}
27. SQL Server uses a write-ahead log
(WAL), which guarantees that no data
modifications are written to disk before
the associated log record is written to
disk.
◦ Source: http://msdn.microsoft.com/en-us/library/ms186259(SQL.90).aspx
Log Files: WAL
By Naji El Kotob {naji@dotnetheroes.com}
28. 1 Data modification is
sent by application Modification is recorded
3 in transaction log on disk
Buffer
Cache
Disk
Disk
Data pages are located in,
2 or read into, buffer cache
and modified Checkpoint writes
4 committed transactions
to database
Log Files: Transaction Logging
Image source: http://www.vovisoft.com/SQLServer2000/images/HowTransactionLogWorks.gif (Nov. 2008)
By Naji El Kotob {naji@dotnetheroes.com}
30. Relationships
By Naji El Kotob {naji@dotnetheroes.com}
31. Unique Key:
◦ It creates non-clustered index by default
◦ It allows only one null value
◦ Multiple Key(s) per table
Primary Key:
◦ It creates clustered index by default
◦ It doesn't allow nulls
◦ One key per table
Foreign Key
◦ A key used in one table to represent the value of a
primary key in a related table. While primary keys must
contain unique values, foreign keys may have duplicates.
Tables: Keys
By Naji El Kotob {naji@dotnetheroes.com}
33. One record in Table-1 has one and only
one matching record in Table-2.
Relationships: One-to-One
By Naji El Kotob {naji@dotnetheroes.com}
34. One record in Table-1 can have multiple
matching records in Tabl-2, but only one
in Table-1.
Relationships: One-to-Many
By Naji El Kotob {naji@dotnetheroes.com}
35. Each record in Table-1 and Table-2 can
have multiple matching records in either
table.
Relationships: Many-to-Many
By Naji El Kotob {naji@dotnetheroes.com}
37. Normalization
By Naji El Kotob {naji@dotnetheroes.com}
38. Normalization is the process of efficiently
organizing data in a database.
◦ Eliminating redundant data (e.g. storing the same
data in more than one table)
◦ Ensuring data dependencies make sense (only
storing related data in a table).
What is Normalization?
By Naji El Kotob {naji@dotnetheroes.com}
39. Project Project Employee Employee Department
ID Name ID Name
123 Payroll 5 Naji IT
8 Dani Finance
134 CRM 7 Sandra IT
5 Naji Marketing
2 Nada HR
Repeating groups of
similar data
ZERO Normal Form
By Naji El Kotob {naji@dotnetheroes.com}
40. Project Project Employee Employee Departmen
ID Name ID Name t
123 Payroll 5 Naji IT
8 Dani Finance
134 CRM 7 Sandra IT
5 Naji Marketing
2 Nada HR
NF1: Project Project Employee Employee Departme
A row of data cannot ID Name ID Name nt
contain repeating 123 Payroll 5 Naji IT
groups of similar data
(atomicity) 123 Payroll 8 Dani Finance
134 CRM 7 Sandra IT
Each row of data must
have a unique identifier 134 CRM 5 Naji IT
(or Primary Key). 134 CRM 2 Nada HR
First Normal Form
By Naji El Kotob {naji@dotnetheroes.com}
41. Project Project Employee Employee Department
ID Name ID Name
123 Payroll 5 Naji IT
123 Payroll 8 Dani Finance
134 CRM 7 Sandra IT
134 CRM 5 Naji IT
134 CRM 2 Nada HR
NF2: Project Project
No Partial ID Name
Dependencies on a 123 Payroll Employee Employee Department
Concatenated Key
134 CRM ID Name
5 Naji IT
8 Dani Finance
7 Sandra IT
2 Nada HR
Second Normal Form
By Naji El Kotob {naji@dotnetheroes.com}
42. Project Project Employee Employee Department Department column:
ID Name ID Name Rely on non-key attributes
123 Payroll 5 Naji IT
Can it exist independent
134 CRM
8 Dani Finance of the Employee ID
column?
7 Sandra IT
2 Nada HR
Project Project
ID Name
Employee Employee
123 Payroll ID Name
134 CRM 5 Naji
8 Dani
NF3: 7 Sandra Department Department
It contains no transitive ID Name
2 Nada
dependencies 1 IT
(No Dependencies on
Non-Key Attributes). 2 Finance
3 HR
Third Normal Form
By Naji El Kotob {naji@dotnetheroes.com}
46. SQL is a standardized query language for
accessing/manipulating data and schema
in relational database management
systems, such as Microsoft SQL Server,
Oracle, etc.
SQL
Data/Feedback
SQL (Structured Query Language)
By Naji El Kotob {naji@dotnetheroes.com}
48. Northwind Sample
Database
SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE‘
Customers
Shippers
Suppliers
Orders
Products
Order Details
CustomerCustomerDemo
CustomerDemographics
Region
Territories
EmployeeTerritories
sysdiagrams
Employees
Categories Source:
http://www.microsoft.com/downloads/details.aspx?Fam
ilyID=06616212-0356-46A0-8DA2-
EEBC53A68034&displaylang=en
By Naji El Kotob {naji@dotnetheroes.com}
49. The SQL SELECT statement is the SQL
command that retrieves data from an SQL
database. This operation is also known as
a query and is the key to the use of SQL
for analysis and reporting.
SQL: Select Statement
By Naji El Kotob {naji@dotnetheroes.com}
50. Let’s experience it ;)
SQL: Select Statement
By Naji El Kotob {naji@dotnetheroes.com}
51. SELECT * FROM Customers
SQL: Select Statement
By Naji El Kotob {naji@dotnetheroes.com}
52. SELECT ContactName + ' (' + CompanyName + ')'
FROM Customers
SQL: Select Statement (Concat)
By Naji El Kotob {naji@dotnetheroes.com}
53. SELECT SUBSTRING(CustomerID, 1, 3) + ' - ' +
CompanyName FROM Customers
SQL: Select Statement (Substring)
By Naji El Kotob {naji@dotnetheroes.com}
54. SELECT DISTINCT Country
FROM Customers
SQL: Select Statement (DISTINCT)
By Naji El Kotob {naji@dotnetheroes.com}
55. SELECT DISTINCT Country
FROM Customers
Order by Country ASC -- or DESC
SQL: Select Statement (ORDER BY)
By Naji El Kotob {naji@dotnetheroes.com}
56. SELECT OrderID, ProductID, (UnitPrice *
Quantity * (1 - Discount)) AS SubTotal
FROM [Order Details]
SQL: Select Statement (Expression)
By Naji El Kotob {naji@dotnetheroes.com}
57. SELECT ORDERID,
SUM((UnitPrice * Quantity * (1 - Discount))) AS
SubTotal
FROM [Order Details]
GROUP BY ORDERID
SQL: Select Statement
(Aggregate Functions)
By Naji El Kotob {naji@dotnetheroes.com}
58. SELECT o.CustomerID,
(SELECT SUM((UnitPrice * Quantity * (1 - Discount))) AS
SubTotal
FROM [Order Details]
WHERE OrderID = o.OrderID)
FROM Orders o
SQL: Select Statement (Aggregate
Functions + Subquery)
By Naji El Kotob {naji@dotnetheroes.com}
59. SELECT ORDERID,
ROUND(SUM((UnitPrice * Quantity * (1 - Discount))), 2) AS
SubTotal
FROM [Order Details]
GROUP BY ORDERID
HAVING SUM(UnitPrice * Quantity * (1 - Discount)) > 500
SQL: Select Statement (Aggregate
Functions + Filtration)
By Naji El Kotob {naji@dotnetheroes.com}
61. ◦ = Equal
◦ <> Not Equal
◦ > Greater Than
◦ < Less Than
◦ >= Greater Than Or Equal
◦ <= Less Than Or Equal
◦ _______________________
◦ TOP # [PERCENT]
◦ BETWEEN
◦ LIKE %, _, [], [^]
◦ IN
◦ IS NULL / IS NOT NULL
◦ NOT, AND, OR
◦ …
SQL: Select Statement: WHERE
By Naji El Kotob {naji@dotnetheroes.com}
66. The SQL join command is used to join
two or more tables.
SQL: Select Statement: JOIN
By Naji El Kotob {naji@dotnetheroes.com}
67. JOIN match in both tables
LEFT JOIN match in the right table
RIGHT JOIN match in the left table
FULL JOIN match in one of the tables
CROSS JOIN Cartesian Product - combines
two tables by generating all possible
SQL: Select Statement: JOINS
By Naji El Kotob {naji@dotnetheroes.com}
68. What’s the name of the top 5 customers
with their order value and order date?
INNER JOIN
By Naji El Kotob {naji@dotnetheroes.com}
69. SELECT TOP 5 C.CustomerID, C.CompanyName, O.OrderDate,
ROUND(SUM((OD.UnitPrice * OD.Quantity * (1 - OD.Discount))), 2)
AS SubTotal
FROM Customers C INNER JOIN
Orders O ON C.CustomerID = O.CustomerID INNER
JOIN
[Order Details] OD ON O.OrderID = OD.OrderID
GROUP BY C.CustomerID, C.CompanyName, O.OrderDate
ORDER BY SubTotal DESC
INNER JOIN
By Naji El Kotob {naji@dotnetheroes.com}
70. Generate a list of customers with the
number of orders?
Generate a list of all the customers with
the number orders?
Generate a list of employees and their
managers?
JOINS: DEMO
By Naji El Kotob {naji@dotnetheroes.com}
71. SELECT Customers.CompanyName,
COUNT(Orders.OrderID) AS [Number of Orders]
FROM Customers INNER JOIN
Orders ON Customers.CustomerID =
Orders.CustomerID
GROUP BY Customers.CompanyName
ORDER BY Customers.CompanyName
INNER JOIN
By Naji El Kotob {naji@dotnetheroes.com}
72. SELECT Customers.CompanyName,
COUNT(Orders.OrderID) AS [Number of Orders]
FROM Customers LEFT JOIN
Orders ON Customers.CustomerID =
Orders.CustomerID
GROUP BY Customers.CompanyName
ORDER BY [Number of Orders] DESC
LEFT JOIN
By Naji El Kotob {naji@dotnetheroes.com}
73. SELECT e.FirstName + ' ' + e.LastName AS 'Employee
Name', m.FirstName + ' ' + m.LastName AS 'Manager
Name'
FROM Employees AS e LEFT OUTER JOIN Employees AS m
ON e.ReportsTo = m.EmployeeID
SELF JOIN
By Naji El Kotob {naji@dotnetheroes.com}
74. SELECT Products.ProductName,
Suppliers.CompanyName
FROM Products CROSS JOIN Suppliers
CROSS JOIN
By Naji El Kotob {naji@dotnetheroes.com}
The flat-file style of database are ideal for small amounts of data that needs to be human readable or edited by hand…The typical flat-file database is split up using a common delimiter. http://websiteowner.info/articles/cgi/databasetypes.aspThe relational databases such as MySQL, Microsoft SQL Server and Oracle, have a much more logical structure in the way that it stores data. Tables can be used to represent real world objects, with each field acting like an attribute. For example, a table called books could have the columns title, author and ISBN, which describe the details of each book where each row in the table is a new book.A data file that is not related to or does not contain any linkages to another file. It is generally used for stand-alone lists. When files must be related (customers to orders, vendors to purchases, etc.), a relational database manager is used, not a flat file manager. Flat files can be related, but only if the applications are programmed to do so. http://www.answers.com/topic/flat-fileLike a flat file, an XML file can contain many different types of data. There are many possible ways to represent the information in a flat file using XML. For example, each field and each record could be an XML element. One advantage of using XML would be that each field is named. A disadvantage is that the file would be larger. A file containing XML is not generally called a flat file, even though it satisfies the definition. It usually is called an XML file.
Relational databases do not link records together physically, but the design of the records must provide a common field, such as account number, to allow for matching. Often, the fields used for matching are indexed in order to speed up the process. http://www.answers.com/topic/dbms-technologyData SecurityData IntegrityInteractive Query
Database integrity ensures that data entered into the database is accurate, valid, and consistent. Any applicable integrity constraints and data validation rules must be satisfied before permitting a change to the database.
tables, indexes, views, defaults, triggers, rules constraints and procedures
Each database consists of at least two files: one is a primary datafile (by default, with the .mdf extension), the other is log file(by default, with the .ldf extension).
RAID 0 (striped disks) distributes data across several disks in a way that gives improved speed and full capacity, but all data on all disks will be lost if any one disk fails. RAID 5 (striped disks with parity) combines three or more disks in a way that protects data against loss of any one disk; the storage capacity of the array is reduced by one disk.
How do I recover data from SQL Server's log files?There are several tools available for reviewing SQL Server log files, and restoring data that was accidentally lost or corrupted, say, after your last backup. Three such products are: Apex SQL Log Log Explorer SQL Log Rescue http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html
Tip: Place log on separate drive for performanceIf the log contains multiple physical log files, the logical log will move through all the physical log files before it wraps back to the start of the first physical log file. http://msdn.microsoft.com/en-us/library/ms179355(SQL.90).aspxhttp://jmkehayias.blogspot.com/2008/11/database-transaction-log-part-2-how.htmlDBCC LOGINFO -- Database Consistency Checker (DBCC)
The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms and are numbered from one (the lowest form of normalization, referred to as first normal form or 1NF) through five (fifth normal form or 5NF). In practical applications, you'll often see 1NF, 2NF, and 3NF along with the occasional 4NF. Fifth normal form is very rarely seen and won't be discussed in this article. http://databases.about.com/od/specificproducts/a/normalization.htm
The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms and are numbered from one (the lowest form of normalization, referred to as first normal form or 1NF) through five (fifth normal form or 5NF). In practical applications, you'll often see 1NF, 2NF, and 3NF along with the occasional 4NF. Fifth normal form is very rarely seen and won't be discussed in this article. http://databases.about.com/od/specificproducts/a/normalization.htm
Next we test each table for partial dependencies on a concatenated key. This means that for a table that has a concatenated primary key, each column in the table that is not part of the primary key must depend upon the entire concatenated key for its existence. If any column only depends upon one part of the concatenated key, then we say that the entire table has failed Second Normal Form and we must create another table to rectify the failure. http://www.phlonx.com/resources/nf3/#intro
At last, we return to the problem of the repeating Department information. As our database now stands, if an employee works in more than one project then we have to input all of that employee's departmentinformation again. This is because there are columns in the Employees table that rely on "non-key attributes".
In 1986, ANSI approved a rudimentary version of SQL as the official standard, but most versions of SQL since then have included many extensions to the ANSI standard. In 1991, ANSI updated the standard. The new standard is known as SAG SQL. http://www.webopedia.com/TERM/S/SQL.htmlAmerican National Standards Institute. This organization is responsible for approving US standards in many areas, including computers and communications. Standards approved by this organization are often called ANSI standards (eg, ANSI C is the version of the C language approved by ANSI). www.incredible.co.za/services/glossary/glossary.asp
SELECT <columnlist>FROM <tablename>* = All Columns
SELECTOrd.OrderID,Ord.OrderDate,(SELECTMAX(OrdDet.UnitPrice)FROM Northwind.dbo.[Order Details] ASOrdDetWHEREOrd.OrderID=OrdDet.OrderID)ASMaxUnitPriceFROMNorthwind.dbo.OrdersASOrdA subquery is a SELECT query that returns a single value and is nested inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. A subquery can be used anywhere an expression is allowed.
Round, Ceiling, Floor, … Mathematical Functions
BETWEEN Between an inclusive range LIKE Search for a pattern % _ [^]IN If you know the exact value you want to return for at least one of the columns select * from orders where CustomerID like '[^vtbsp]%'select * from Orders WHERE OrderDate BETWEEN '1996-08-01' AND '1996-09-02'
At times you may need to join two or more tables to retrieve the information you need from your database.