D
D
Daniel Demidko2017-04-09 10:35:44
SQL
Daniel Demidko, 2017-04-09 10:35:44

The essence of database concepts?

The problem is the following. I want to fill my gap in knowledge about SQL, what it is and what it is eaten with (I need this because almost all C# jobs require additional knowledge of SQL).
When I start reading books on SQL, I immediately come across query syntax, tables, and so on. This is all fine, of course, but it does not give me an understanding of such basic questions as:
- What is a specific Database in general?
Is it a separate file, like a dynamic library that contains data or something else? Where should it be located - at the DBMS or in the directory with the program using it?
- What executes SQL queries if we, for example, call them from C# code?
DBMS installed on the computer? Library in .NET?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2017-04-09
@tsklab

What is a specific Database in general?
In simpler words, this is a
DBMS

D
dinegnet, 2017-04-09
@dinegnet

SQL require generally more programmer vacancies. Not only in C#...
At one time, SQL was invented so that simple MANAGERS, not programmers at all, could get data from the database by writing queries in almost natural English. It's simple.
As a rule, SQL refers to the so-called. relational databases. Recently, simplified versions of SQL have been used for others, but still SQL was born and optimized for relational ones.
A relational database is a set of tables with columns whose fields are related in meaning.
The columns are fixed, have their own names. The table grows row by row, rows can be units or millions - it doesn't matter.
Moreover, the order of the lines does not matter - that is, once you get the lines from the table in one order, another time in a different order, such as it is convenient for the program, and not for you. If the order is important to you, you need to explicitly indicate this in the request, but such a requirement reduces the speed of the request.
Example:
Table "Teachers"
Column "Last name", Column "Date of birth", Column "Cost of an academic hour"
Table "Groups of students"
Column "Name", Column "Number"
Table "Classes"
Column "Group name", "Last name of the teacher ", "Subject name", "Class date"
SELECT Last Name, SUM(Tutorial Cost) FROM Teachers, Classes WHERE Teachers. Last Name = Lessons. Instructor Last Name GROUP BY Last Name
Or what our school costs for different types of classes
SELECT Subject Name, SUM(Tutorial Costs) FROM Teachers, Classes WHERE Instructors.LastName = Classes.Instructor LastName GROUP BY Subject Name
Or Display Schedule SELECT Subject Name, Group Name, Instructor Last Name, Class Date FROM Instructors ,
Classes WHERE Classes ORDER BY Class Date
which you use to access the database) is the path to this file. It can be several files - a directory. Also indicate the path.
It can be a database server - a separate program. How it stores data, in what files is not your concern. To access the database, you need to specify the server name (or its IP address or unix socket or named pipe), the name of the database, username and password.
In the first case, SQL is executed by some library (included in the standard .NET distribution or additionally installed), which you need to remember to include in the distribution of your final program.
In the second case, some separate program executes SQL. But "a certain library" is also used here. It talks to the database server in a special language, a protocol (which you don't need to know or even useful).
However, SQL is just ONE OPTION for manipulating database data. Pretty versatile and comfortable.
There is also ORM - this is a class of tools, not a language. It is closer to the original programming language.
Specifically for C#, there is an even cooler tool - LINQ.
And you can also communicate in the database with stupid commands without all this. And write something like: "take all the lines from the Teachers table, store them in an array, then ....."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question