What are the SQL Server System databases? — Parv The IT Geek

SQL Server System databases SQL Server has 5 very default system databases which are Master As the name implies this is one of the most important databases on the system and without it SQL Server will not start. It stores all the configuration of the instance and all other databases which are subsequently created. TheContinue reading “What are the SQL Server System databases? — Parv The IT Geek”

How can I find out what SQL Server version is running? — Parv The IT Geek

I was asked by someone which SQL Server version a server was running and was surprised when my DBA colleague said to run a stored procedure I had never heard of. I had not thought that there would be more than one way as the usual method I used below was so simple I didn’tContinue reading “How can I find out what SQL Server version is running? — Parv The IT Geek”

What is Denormalization? — Parv The IT Geek

This is simply the process of combining smaller tables to make larger tables. This can be used to address problems with performance or scalability. This is usually caused by tables being stored in separate files on disks and when databases are being queried there is a requirement for each several files to be accessed accordingContinue reading “What is Denormalization? — Parv The IT Geek”

What is Normalization? — Parv The IT Geek

I would simply describe this as the process of making big tables into smaller tables. The proper definition is that database normalization is a method of reorganising data within tables to reduce the level of dependency. This helps to isolate data so that insertion, deletions and updates in a field can be made into aContinue reading “What is Normalization? — Parv The IT Geek”

What are DDL , DML, DCL and TCL ? — Parv The IT Geek

These are used to create and manage the structure of objects within a database. For example, CREATE, DROP, ALTER commands ON tables, views, indexes, keys… DML — Data Manipulation Language These are the commands used to actually query, modify and delete data within a database. For example SELECT, INSERT, UPDATE, DELETE. DCL — Data Control Language These are usedContinue reading “What are DDL , DML, DCL and TCL ? — Parv The IT Geek”

What is CRUD (Create, read, update and delete ) — Parv The IT Geek

CRUD is used to describe the majority of commands which are used within databases. Some database professionals I know have used the term BREAD instead which stands for for “Browse, Read, Edit, Add, Delete”. Create Basically this means adding something new This can be used to add new data or objects…. Read This means toContinue reading “What is CRUD (Create, read, update and delete ) — Parv The IT Geek”

Create a new column with an Expression — Parv The IT Geek

Sometimes there may be a requirement to create a new column based upon existing columns with a minor manipulation. For example in the AdventureWorks database the table TransactionHistoryArchive shows the quantity and the actual cost of each unit but not the total value of the order. That would be achieved by multiplying the Quantity andContinue reading “Create a new column with an Expression — Parv The IT Geek”

AS — Rename output columns — Parv The IT Geek

Sometimes when you run a query you may want to rename the columns in the results. This is quite a simple process within SQL. First you will need to know the source column names. For example USE AdventureWorks SELECT * FROM [HumanResources].[Department] Or you can open up the table which gives the column names. YouContinue reading “AS — Rename output columns — Parv The IT Geek”

SELECT — Returning specific columns — Parv The IT Geek

There are many times where returning all the data held within all the columns in a table are unnecessary and inefficient. For example. SELECT * FROM HumanResources.Department If you expand out the HumanResources.Department then you will get a list of the columns as well as some information on the columns. To get only the DepartmentIDContinue reading “SELECT — Returning specific columns — Parv The IT Geek”

SQL — Hello World — Parv The IT Geek

In a time-honoured tradition in every programming language the first thing they teach you is how to get the system to put ‘Hello World’ on to your screen. This is accomplished by using the below command. Play about with the PRINT command and see what else you can get the system to reproduce. Originally publishedContinue reading “SQL — Hello World — Parv The IT Geek”