Giới thiệu
hocvietcode.com là website chia sẻ và cập nhật tin tức công nghệ, chia sẻ kiến thức, kỹ năng. Chúng tôi rất cảm ơn và mong muốn nhận được nhiều phản hồi để có thể phục vụ quý bạn đọc tốt hơn !
Liên hệ quảng cáo: trienkhaiweb@gmail.com
To install SQL Server, the first thing we need to do is go to google, type keywords: download sql server, or go directly to the following link:
https://www.microsoft.com/en-us/sql-server/sql-server-downloads
Next step, choose 1 of 2 developer or express versions as shown and proceed to download + install step by step according to the video above
After installing according to the video, connect to the database using SSMS according to the information as shown below:
Note: there are 2 methods to authenticate with Microsoft SQL Server: through accounts (SQL Server Authentication) or authentication with windows (windows authentication). So multiple accounts can access SQL server. With Windows Authentication, the operating system authentication system to log in to SQL Server Database, it can only authenticate on a single computer device, cannot be used on any other machine.
After successful authentication login, the interface will display as follows:
Mục lục
Database is a collection (list) of data stored as files on the hard drive. A data database holds the actual data.
SQL Server databases are made up of a collection of tables that store specifically structured data sets. A table consists of a set of rows (also known as records or tuples) and columns (also known as attributes). Each column in the table is intended to store a specific type of information, for example, date, name, amount, and number.
SQL Server 2019 supports 3 types of databases as follows:
SQL Server uses system databases to support the various components of the DBMS. Each database has a role that authenticates and stores the business information required by SQL Server. System database stores data on tables, will contain views, stored procedures (will be learned in later lessons) and other database objects. They also link to database files (.mdf, .ldf files), which are physical files stored on the SQL Server server.
System databases available in SQL Server 2019
Database | Describe |
master | The database records record all the system layer information of the SQL Server instance |
msdb | The database is used by SQL Server Agent to schedule database alerts and various jobs |
model | Database is used as a template for all databases to be created in SQL Server 2019 |
resources | This is a read-only database. It contains system objects in SQL 2019 |
tempdb | This is a database containing temporary object dodois or intermediate result sets |
Using SQL Server 2019, users can create their own database, called user-defined database, and work with it. The purpose of these databases is to store user data.
The sample database, named AdventureWorks, was introduced in SQL Server 2005. This database demonstrates the moiws features of SQL server. This database simulates a fictional company called Adventure Works Cycles. Adventure Work Cycles is a large, multinational manufacturing company. The company manufactures and sells alloy bicycles to the North American, European, Asian markets… In SQL Server 2019, the new version of AdventureWorks2019 is used as sample data, including datasets, datasets, and datasets. commands and operations available in a simulated data environment.
Video tutorial to import AdventureWorks database into SQL Server:
The AdventureWorks2019 database schema includes many functions for a fictional bicycle manufacturer. These areas include:
The database includes several features. Some of the main features are as follows:
A database engine that includes administrative utilities, data accessibility, full-text search facility, Common Language Runtime (CLR), etc.
A set of integrated templates for two business models Human Resource and Storefront with many features:
The sample database includes 3 main components:
To download adventurewrork and use it, see the following link:
SSMS provides several option menus, toolbars, and panes to work with. The pane shown in Figure 1.1 above is called Object Explorer. It displays all the objects on the server in a tabular format and provides user interfaces for managing them.
The structure of Object Explorer in SQL Server 2019 is shown in the figure below:
This structure includes database, security, server objects, replications, and possibly some other features like AlwaysOn High Availability, Management, Integration Services Catalogs… Object Explorer can be accessed through SSMS by connecting connect to the database server.
The different components of Object Explorer are as follows:
The Query Window is an area where you can write Transact-SQL (T-SQL) query commands. The results of the queries will be displayed in this window.
Script files are files that contain a collection of SQl statements. Script files can contain one or more SQL statements, script files are stored in a .sql file that helps SQL Server recognize and execute the script.
The conceptual lopws in script files can be organized as shown below:
Solution in the picture can be understood as a file in which all SQL Server projects are stored, meaning it is the top layer of the hierarchy. The Solution file is stored as a text file with the extension .ssmssqlprj . Script files are core files that will be queried and executed. The script file has the extension .sql
The example below is a script file named: insertdata.sql
Transact-SQL (T-SQL) queries are written and stored under the .sql script file and can be executed directly in the query window in SSMS. The steps to execute Transact-SQL are as follows:
The results will be displayed in 3 different formats, the formats are grid (grid), text (text), file view (file).
hocvietcode.com là website chia sẻ và cập nhật tin tức công nghệ, chia sẻ kiến thức, kỹ năng. Chúng tôi rất cảm ơn và mong muốn nhận được nhiều phản hồi để có thể phục vụ quý bạn đọc tốt hơn !
Liên hệ quảng cáo: trienkhaiweb@gmail.com