Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. USE [master]
  2. GO
  3. /****** Object: Database [StudentDatabase] Script Date: 2019-09-20 15:05:49 ******/
  4. CREATE DATABASE [StudentDatabase]
  5.  
  6. ALTER DATABASE [StudentDatabase] SET COMPATIBILITY_LEVEL = 140
  7. GO
  8. IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
  9. begin
  10. EXEC [StudentDatabase].[dbo].[sp_fulltext_database] @action = 'enable'
  11. end
  12. GO
  13. ALTER DATABASE [StudentDatabase] SET ANSI_NULL_DEFAULT OFF
  14. GO
  15. ALTER DATABASE [StudentDatabase] SET ANSI_NULLS OFF
  16. GO
  17. ALTER DATABASE [StudentDatabase] SET ANSI_PADDING OFF
  18. GO
  19. ALTER DATABASE [StudentDatabase] SET ANSI_WARNINGS OFF
  20. GO
  21. ALTER DATABASE [StudentDatabase] SET ARITHABORT OFF
  22. GO
  23. ALTER DATABASE [StudentDatabase] SET AUTO_CLOSE OFF
  24. GO
  25. ALTER DATABASE [StudentDatabase] SET AUTO_SHRINK OFF
  26. GO
  27. ALTER DATABASE [StudentDatabase] SET AUTO_UPDATE_STATISTICS ON
  28. GO
  29. ALTER DATABASE [StudentDatabase] SET CURSOR_CLOSE_ON_COMMIT OFF
  30. GO
  31. ALTER DATABASE [StudentDatabase] SET CURSOR_DEFAULT GLOBAL
  32. GO
  33. ALTER DATABASE [StudentDatabase] SET CONCAT_NULL_YIELDS_NULL OFF
  34. GO
  35. ALTER DATABASE [StudentDatabase] SET NUMERIC_ROUNDABORT OFF
  36. GO
  37. ALTER DATABASE [StudentDatabase] SET QUOTED_IDENTIFIER OFF
  38. GO
  39. ALTER DATABASE [StudentDatabase] SET RECURSIVE_TRIGGERS OFF
  40. GO
  41. ALTER DATABASE [StudentDatabase] SET DISABLE_BROKER
  42. GO
  43. ALTER DATABASE [StudentDatabase] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
  44. GO
  45. ALTER DATABASE [StudentDatabase] SET DATE_CORRELATION_OPTIMIZATION OFF
  46. GO
  47. ALTER DATABASE [StudentDatabase] SET TRUSTWORTHY OFF
  48. GO
  49. ALTER DATABASE [StudentDatabase] SET ALLOW_SNAPSHOT_ISOLATION OFF
  50. GO
  51. ALTER DATABASE [StudentDatabase] SET PARAMETERIZATION SIMPLE
  52. GO
  53. ALTER DATABASE [StudentDatabase] SET READ_COMMITTED_SNAPSHOT OFF
  54. GO
  55. ALTER DATABASE [StudentDatabase] SET HONOR_BROKER_PRIORITY OFF
  56. GO
  57. ALTER DATABASE [StudentDatabase] SET RECOVERY FULL
  58. GO
  59. ALTER DATABASE [StudentDatabase] SET MULTI_USER
  60. GO
  61. ALTER DATABASE [StudentDatabase] SET PAGE_VERIFY CHECKSUM
  62. GO
  63. ALTER DATABASE [StudentDatabase] SET DB_CHAINING OFF
  64. GO
  65. ALTER DATABASE [StudentDatabase] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
  66. GO
  67. ALTER DATABASE [StudentDatabase] SET TARGET_RECOVERY_TIME = 60 SECONDS
  68. GO
  69. ALTER DATABASE [StudentDatabase] SET DELAYED_DURABILITY = DISABLED
  70. GO
  71. ALTER DATABASE [StudentDatabase] SET QUERY_STORE = OFF
  72. GO
  73. USE [StudentDatabase]
  74. GO
  75. /****** Object: Table [dbo].[Course] Script Date: 2019-09-20 15:05:49 ******/
  76. SET ANSI_NULLS ON
  77. GO
  78. SET QUOTED_IDENTIFIER ON
  79. GO
  80. CREATE TABLE [dbo].[Course](
  81. [courseID] [nchar](10) NOT NULL,
  82. [credits] [nchar](10) NOT NULL,
  83. [name] [nchar](10) NOT NULL,
  84. CONSTRAINT [PK_Course] PRIMARY KEY CLUSTERED
  85. (
  86. [courseID] ASC
  87. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  88. ) ON [PRIMARY]
  89. GO
  90. /****** Object: Table [dbo].[HasStudied] Script Date: 2019-09-20 15:05:49 ******/
  91. SET ANSI_NULLS ON
  92. GO
  93. SET QUOTED_IDENTIFIER ON
  94. GO
  95. CREATE TABLE [dbo].[HasStudied](
  96. [ssn] [nchar](10) NOT NULL,
  97. [courseID] [nchar](10) NOT NULL,
  98. [grade] [nchar](10) NOT NULL
  99. ) ON [PRIMARY]
  100. GO
  101. /****** Object: Table [dbo].[Student] Script Date: 2019-09-20 15:05:49 ******/
  102. SET ANSI_NULLS ON
  103. GO
  104. SET QUOTED_IDENTIFIER ON
  105. GO
  106. CREATE TABLE [dbo].[Student](
  107. [ssn] [nchar](10) NOT NULL,
  108. [name] [nchar](10) NOT NULL,
  109. [address] [nchar](10) NOT NULL,
  110. CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED
  111. (
  112. [ssn] ASC
  113. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  114. ) ON [PRIMARY]
  115. GO
  116. ALTER TABLE [dbo].[HasStudied] WITH CHECK ADD CONSTRAINT [FK_HasStudied_Course] FOREIGN KEY([courseID])
  117. REFERENCES [dbo].[Course] ([courseID])
  118. GO
  119. ALTER TABLE [dbo].[HasStudied] CHECK CONSTRAINT [FK_HasStudied_Course]
  120. GO
  121. ALTER TABLE [dbo].[HasStudied] WITH CHECK ADD CONSTRAINT [FK_HasStudied_Student] FOREIGN KEY([ssn])
  122. REFERENCES [dbo].[Student] ([ssn])
  123. GO
  124. ALTER TABLE [dbo].[HasStudied] CHECK CONSTRAINT [FK_HasStudied_Student]
  125. GO
  126. USE [master]
  127. GO
  128. ALTER DATABASE [StudentDatabase] SET READ_WRITE
  129. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement